2.2-Symmetric and Asymmetric Ciphers
2.2-Symmetric and Asymmetric Ciphers
2
Sergio Pastrana
Contents
3
Sergio Pastrana
CRYPTOSYSTEM MODEL (encryption)
Key
generation
kE kD
Cryptogram
or Cyphertext
Plaintext Plaintext
(CT)
ALICE (PT) Encrypt Decrypt (PT) BOB
(insecure
channel)
4
Sergio Pastrana
CRYPTOSYSTEM MODEL (encryption)
• Message space:
M = {m1, m2, ... , mn}
• Ciphertext space:
C = {c1, c2, ... , cn}
• Key space:
K = {k1, k2, ..., knk}
• Set of encryption functions:
Ek : M 🡪 C
• Set of decryption functions:
Dk : C 🡪 M
5
Sergio Pastrana
CRYPTOSYSTEM MODEL (encryption)
6
Sergio Pastrana
CODES VS CIPHERS
– Coding system
M Algorithm C
C=f(M)
– Encryption system
M Algorithm C
C=E(k, M)=Ek(M)
7
Sergio Pastrana
CRYPTANALYSIS
• CRYPTANALYSIS:
– Methods used to extract knowledge from encrypted data,
without having access to the secret information
– Kerckhoffs's principle:
8
Sergio Pastrana
CRYPTANALYSIS
9
Sergio Pastrana
Contents
10
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
• INTRODUCTION
11
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
• INTRODUCTION
Two basic techniques are used. Both of them work with characters:
12
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
• EXAMPLE: TRANSPOSITION BY COLUMNS/ROWS
• How it works:
1. Symbols are placed following a certain geometric pattern,
2. And then extracted according to a certain path.
Bidimensional pattern (matrix).
– Symbols are placed in consecutive rows (columns) and then extracted column by column
(row by row) from the first to the last.
T H I S I
S A N E X
M = THIS IS AN EXAMPLE OF COLUMN TRANSPOSITION A M P L E
O F C O L
C = TSAOUASN HAMFMNIX INPCNSTX SELOTPIX IXELROOX
U M N T R
A N S P O
S I T I O
N X X X X
13
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
• EXAMPLE: COLUMNAR TRANSPOSITION, WITH A KEY
Key = SPAIN (alphabetical order: A,I,N,P,S)
M = THIS IS AN EXAMPLE OF COLUMN TRANSPOSITION
S P A I N A I N P S
T H I S I I S I H T
S A N E X N E X A S
A M P L E P L E M A
O F C O L C O L F O
U M N T R N T R M U
A N S P O S P O N A
S I T I O T I O I S
N X X X X X X X X N
C = INPCNSTX SELOTPIX IXELROOX HAMFMNIX TSAOUASN
14
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
• SUBSTITUTION
Spanish
NUMERICAL REPRESENTATION OF THE ALPHABETS alphabet ->
27 letters
• 27 letters alphabet: (A, B,..., Z) 🡪 (0, 1,...,26)
• 37 letters alphabet: (A, B,..., Z, 0, 1, ...9) 🡪 (0, 1,...,36)
English
alphabet ->
26 letters
15
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
– EXAMPLE: SIMPLE MONOALPHABETIC SUBSTITUTION - CAESAR
CIPHER Spanish
alphabet 🡪
E3(x) = (x + 3) mod 27 mod 27
D3(x) = (x - 3) mod 27
English
alphabet 🡪
mod 26
16
Sergio Pastrana
Reminder: mod n
• Reduction modulo n
Let be a, n ∈ Z (n ≠ 0). Reduction modulo n is the function that
applied to a, returns r ∈ Z+ + ⎨0⎬ / r ∈ ⎨0,1,...n-1⎬ and a ≡ r (mod
n)
a (mod. n) = r ⇒ a ≡ r (mod. n) and r ∈ ⎨0,1,...n-1⎬
Note: “r is the reminder of the integer division of a and n (for a > 0)”
26 (mod. 5) = 5 · 5 + 1 (mod. 5) = 1 (1<5-1) p.t. 26 ≡ 1 (mod. 5)
30 (mod. 7) = 4 · 7 + 2 (mod. 7) = 2 (2<7-1) p.t. 30 ≡ 2 (mod. 7)
11 (mod. 33) = 11 (11<33-1)
256 (mod. 8) = 32·8+0 (mod. 8) = 0 (0<8-1) p.t. 256 ≡ 0 (mod. 8)
-17 (mod. 12) ≡ -17 + 2 · 12 = 7 (7<12-1) p.t. -17 ≡ 7 (mod. 12)
17
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
• SIMPLE MONOALPHABETIC SUBSTITUTION (MONOGRAPHIC)
Substitution of 1 character of plaintext by 1 character of ciphertext
E(mi)=(ami+b) mod. n
a : decimation constant
b : shift constant
n : number of letters of the alphabet (26 for English, 27 for Spanish)
Key = (a,b)
Condition for the existence of solution of the equation, and hence, to allow
decryption
gcd(a,n) = 1
18
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
• PERIODIC POLYALPHABETIC SUBSTITUTION
where:
bi = shift for alphabet i
mj = letter in the j-th position in the text
E(mj) = Encrypted character
19
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
Vigenére’s table (English alphabet, 26 letters)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
A : A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B : B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
C : C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D : D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
E : E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
F : F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
G : G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
… … … … … … … … … … … … … … … … … … … … … … … … …
T : T U V W X Y Z A B C D E F G H I J L K M N O P Q R S
U : U V W X Y Z A B C D E F G H I J L K M N O P Q R S T
V : V W X Y Z A B C D E F G H I J L K M N O P Q R S T U
W : W X Y Z A B C D E F G H I J L K M N O P Q R S T U V
X : X Y Z A B C D E F G H I J L K M N O P Q R S T U V W
Y : Y Z A B C D E F G H I J L K M N O P Q R S T U V W X
Z : Z A B C D E F G H I J L K M N O P Q R S T U V W X Y
20
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
Vigenére’s table (English alphabet, 26 letters)
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
A : A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
B : B C D E F G H I J K L M N O P Q R S T U V W X Y Z A
C : C D E F G H I J K L M N O P Q R S T U V W X Y Z A B
D : D E F G H I J K L M N O PPlaintext
Q R S alphabets
T U V W X Y Z A B C
E : E F G H I J K L M N O P Q R S T U V W X Y Z A B C D
F : F G H I J K L M N O P Q R S T U V W X Y Z A B C D E
G : G H I J K L M N O P Q R S T U V W X Y Z A B C D E F
… … … … … … … … … … … … … … … … … … … … … … … … …
T : T U V W X Y Z A B C D E F G H I J L K M N O P Q R S
U : U V W X Y Z A B C D E F G H I J L K M N O Encryption
P Q R S alphabet
T
V : V W X Y Z AEncryption F G H I J L K M N O P with
B C D Ealphabet Q Rki S
== T“Y”U(bi = 24)
W : W X Y Z A B C D E F G H I J L K M N O P Q R S T U V
X : X Y Z A B C D E F G H I J L K M N O P Q R S T U V W
Y : Y Z A B C D E F G H I J L K M N O P Q R S T U V W X
Z : Z A B C D E F G H I J L K M N O P Q R S T U V W X Y
21
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
Vigenére’s key:
• The key defines the shift used for each letter in the plaintext,
i.e.: SOL
• Encryption
Message: H E L L O M A T E
Periodic key: S O L S O L S O L
Chipertext: Z S W D C X S H P
22
Sergio Pastrana
CLASSICAL CRYPTOGRAPHY
• Enigma machine
• Used in World War II by Germany for encryption and decryption of top
secret documents.
23
Sergio Pastrana
CRYPTANALYSIS
EXAMPLE: CIPHER TEXT: HAAH JRHA KHDU
• Brute-force attack ---------------------------
Shift: 0: haah jrha khdu
– Try every possible key Shift: 1: ibbi ksib liev
Shift: 2: jccj ltjc mjfw
Shift: 3: kddk mukd nkgx
– Worst case (for the Shift: 4: leel nvle olhy
Shift: 5: mff mowmf pmiz
attacker): try all the keys Shift: 6: nggn pxng qnja
Shift: 7: ohho qyoh rokb
Shift: 8: piip rzpi splc
– Best case (for the attacker): Shift: 9: qjjq saqj tqmd
Shift: 10: rkkr tbrk urne
try only one key Shift: 11: slls ucsl vsof
Shift: 12: tmmt vdtm wtpg
– On average, half of the keys Shift: 13: unnu weun xuqh
Shift: 14: voov xfvo yvri
Shift: 15: wppw ygwp zwsj
must be tried Shift: 16: xqqx zhxq axtk
Shift: 17: yrry aiyr byul
Shift: 18: zssz bjzs czvm
Shift: 19: atta ckat dawn
Shift: 20: buub dlbu ebxo
Shift: 21: cvvc emcv fcyp
Shift: 22: dwwd fndw gdzq
Shift: 23: exxe goex hear
Shift: 24: fyyf hpfy ifbs
Shift: 25: gzzg iqgz jgct
24
Sergio Pastrana
CRYPTANALYSIS
• Average time required for exhaustive key search (half of the keys)
Reasonable Parallel processing
assumption assumption
128 2128 = 3,4 · 1038 2127 ns = 5,3 · 1021 years 5,3 · 1017 years
168 2168 = 3,7 · 1050 2167 ns = 5,8 · 1033 years 5,8 · 1029 years
192 2192 = 6,3 · 1057 2191 ns = 9,8 · 1040 years 9,8 · 1036 years
256 2256 = 1,2 · 1077 2255 ns = 1,8 · 1060 years 1,8 · 1056 years
26 characters 26! = 4 · 1026 2 · 1026ns = 6,3 · 109 years 6,3 · 106 years
(permutation)
Frequency Analysis
Letter
distribution in
English language
26 Sergio Pastrana
CRYPTANALYSIS
Frequency Analysis
TH, EA, OF, TO, IN, IT, IS, BE, AS, AT,
Common pairs SO, WE, HE, BY, OR, ON, DO, IF, ME,
MY, UP
Common repeated letters SS, EE, TT, FF, LL, MM and OO
Common triplets THE, EST, FOR, AND, HIS, ENT or THA
Visit
https://www.simonsingh.net/The_Black_Chamber/crackingsubstitution.html
27 Sergio Pastrana
Contents
28
Sergio Pastrana
Modern ciphers
29
Sergio Pastrana
Symmetric cryptosystem model (encryption)
k = secret key k k
shared between
sender and receiver
M
C M
Plaintext Cryptogram Plaintext
Sender Encryption Decryption Receiver
(insecure channel
)
C= E (k, M) = Ek (M)
M= D (k, C) = Dk (C)
30
Sergio Pastrana
Asymmetric (public key) cryptosystem model (encryption)
M C M
Sender Encryption Cryptogram Decryption Plaintext Receiver
Plaintext
(insecure channel
)
31
Sergio Pastrana
Modern ciphers
32
Sergio Pastrana
Stream ciphers vs block ciphers
33
Sergio Pastrana
Contents
34
Sergio Pastrana
Stream ciphers. Introduction
• They divide the whole message in symbols
(characters or bits):
M = m1, m2, ... mn
35
Sergio Pastrana
One-time-pad (Vernam)
• Encryption: E(M) = M ⊕ K = m1 ⊕ k1, m2 ⊕ k2, …, mn ⊕ kn
1 0 0 1 1 1 0 1 M
⊕ 0 0 1 0 0 1 0 1 K
1 0 1 1 1 0 0 0 C = E(M)
• Decryption: M = C ⊕ K
36
Sergio Pastrana
Stream ciphers. Introduction
• Vernam is not a practical cipher
Keystream Keystream
Base key Base key
generator generator
(PRNG) (PRNG)
(insecure M
M ⊕ C cannel) C ⊕
37
Sergio Pastrana
Pseudorandom Number Generators (PRNG)
Sergio Pastrana
Pseudorandom Number Generators (PRNG)
• Based on existing cryptographic algorithms
– Symmetric ciphers
– Asymmetric ciphers
– Hash functions
• Ad-hoc
– Shift register generator
– LFSR (linear feed-back shift register)
– A5/1 (2000)
– A5/2 (2001)
– RC4 PRNG
39
Sergio Pastrana
Types of stream ciphers
• Synchronous
• Sender and receiver have to be externally synchronized
• Keystream generation is done independently of the plaintext and
the ciphertext
⊕
K ⊕
K
M C M
40
Sergio Pastrana
Types of stream ciphers
• Self-synchronyzed
• Sender and receiver are automatically synchronyzed
– by means of a certain number of keystream bits
• Keystream is a function of previously encrypted symbols
K K
M ⊕ C ⊕ M
41
Sergio Pastrana
Stream ciphers. Pros & cons
• Advantages:
– Character by character (8-bit) or bit by bit transformation
• High encryption rates
– Easy implementation
– Error resistance. Channel errors do not propagate through
the sequence
• Disadvantages:
– Poor diffusion of the information
• Information of each symbol of plaintext M is exclusively
passed onto the corresponding ciphertext (C) element
– Keystreams are never purely random
• Deterministic keystream generation
– Key reuse issue
42
Sergio Pastrana
Stream ciphers. Cryptanalysis
• Key reuse issues:
– Known plaintext attack
Having M and C, K is calculated as follows:
M⊕C=M⊕M⊕K=K
43
Sergio Pastrana
Stream ciphers. Robustness
Source: ECRYPT-CSA. Algorithms, Key Size and Protocols Report (2018), 28 February 2018
https://www.ecrypt.eu.org/csa/documents/D5.4-FinalAlgKeySizeProt.pdf
44
Sergio Pastrana
Contents
45
Sergio Pastrana
Block ciphers
• M is divided in blocks of equal length:
M1, M2, ... Mn
46
Sergio Pastrana
Block ciphers. Very simple BC
• Key = 4
• Encrypted message:
2F E5 E3 E5 2D 2D E5 22 D0 7F
D0 20 E3
• plaintext?
• 2F E5 E3 E5 2D 2D E5 22 D0 7F D0 20 E3
Using the cipher table
• 74 6f 6d 6f 72 72 6f 77 20 34 20 70 6d
https://www.binaryhexconverter.com/hex-to-binary-converter
• 0111010001101111011011010110111101110010011100100110
1111011101110010000000110100001000000111000001101101
https://www.binaryhexconverter.com/binary-to-ascii-text-converter
• tomorrow 4 pm
49
Sergio Pastrana
Encryption
• M: tomorrow 4 pm
https://www.binaryhexconverter.com/ascii-text-to-hex-converter
• 74 6f 6d 6f 72 72 6f 77 20 34 20 70 6d
Using the cipher table (K = 4)
• 2F E5 E3 E5 2D 2D E5 22 D0 7F D0 20 E3
50
Sergio Pastrana
Block ciphers. Principles
• Substitution of very long “characters”
– 64 bits or more
51
Sergio Pastrana
Block ciphers. Principles
52 Sergio Pastrana
Block ciphers. Principles
– Confusion
• seeks to make C - k statistical relationship as complex as possible
• achieved by the use of a complex substitution algorithm
53 Sergio Pastrana
Block ciphers. Scheme
INPUT
INITIAL
TRANSFORMATION
FINAL
TRANSFORMATION
OUTPUT
54 Sergio Pastrana
Block ciphers. Scheme
– Feistel scheme
• Camellia
• Blowfish, KASUMI, Three-Key 3DES, Two-Key 3DES
• DES
55
Sergio Pastrana
Block ciphers. Feistel scheme
Mi
L0 R0
k1
Repeated in each ⊕ F
round
L1 R1
.
.
.
Ln-1 Rn-1
Ln Rn
Ci
56
Sergio Pastrana
Block ciphers. Feistel scheme
• Divide the block into two halves L0 and R0
• Repeat it n rounds
57
Sergio Pastrana
Block ciphers. Feistel scheme
• Decryption uses the same circuit as encryption
– Just use the subkeys in reverse order
– A final permutation is needed
58
Sergio Pastrana
Block ciphers. Substitution–permutation network
scheme
• Round function usually
consists in three steps:
– Mix Mi with subkey ki
– Substitution using a set of
Substitution-Boxes (S-boxes)
– Permutation using a set of
Permutation-Boxes (P-boxes)
Repeated in each
round
61
Sergio Pastrana
Data Encryption Standard (DES)
• 1990: Differential cryptanalysis (Biham and Shamir)
– 247 chosen plaintexts needed. Effort on 247 encryptions
– Lucifer was vulnerable but DES is not
62
Sergio Pastrana
Data Encryption Standard (DES)
• 1999: Triple DES as new standard
– 3 DES with 2 keys => 112 bit key
• C = E(k1, D(k2, E(k1,M)))
• Compatibility with simple DES if k1=k2
– 3 DES with 3 keys => 168 bit key
• C = E(k3, D(k2, E(k1,M)))
– DES just for legacy systems
63
Sergio Pastrana
Advanced Encryption Standard (AES)
Sept 1997 Call for proposals A lot of candidates
Oct 2,
The winner is announced Rijndael is the winner!!!!!!!!
2000
64
Sergio Pastrana
Advanced Encryption Standard (AES)
• Operates on blocks of 16 bytes (128 bits)
65
Sergio Pastrana
66
Advanced Encryption Standard (AES)
Sergio Pastrana
Block ciphers. Pros and cons
Advantages: Disadvantages:
• Symmetry: • Slower than stream ciphers
– Encryption and decryption are • Error propagation (within block)
similar
• Need padding
– Same circuit allows encryption and
decryption (not always, e.g. AES) – Padding gives clues to cryptanalists
– If M length is not a multiple of the
• High difussion block size, C length is bigger
• Fundamentals studied in depth • Vulnerable to attacks if blocks
• Efficiency are repeated and other vul. 🡪
– High encryption speed Need of operation modes
– Easy implementation
67 Sergio Pastrana
Block ciphers. Cryptanalysis
• Calculating an AES key (brute force)
https://security.stackexchange.com/questions/82389/calculate-time-taken-to-br
eak-aes-key
68
Sergio Pastrana
Block ciphers. Cryptanalysis
69
Sergio Pastrana
Block ciphers. Cryptanalysis
70
Sergio Pastrana
Block ciphers. Robustness
Source: ECRYPT-CSA. Algorithms, Key Size and Protocols Report (2018), 28 February 2018
https://www.ecrypt.eu.org/csa/documents/D5.4-FinalAlgKeySizeProt.pdf
71
Sergio Pastrana
Contents
72
Sergio Pastrana
Confidentiality operation modes
• Technique for enhancing the effect of a cryptographic
algorithm or adapting the algorithm for an application
• Intended for use with any symmetric block cipher
• Five confidentiality modes defined by NIST (SP 800-38A)
There are other modes designed for other or more specific needs
73
Sergio Pastrana
Electronic CodeBook (ECB)
74
Sergio Pastrana
ECB mode. Problem
• The same block of plaintext produces the same ciphertext
Original
image
75
Sergio Pastrana
ECB mode. Problem
• The same block of plaintext produces the same ciphertext
Image encrypted
using ECB
76
Sergio Pastrana
ECB mode. Problem
• The same block of plaintext produces the same ciphertext
77
Sergio Pastrana
ECB mode.
Advantages and disadvantages
• Advantages:
– Block encryption and decryption can be executed in parallel
– Ideal for a short amount of data
• e.g. symmetric key
– Bit errors in transmission do not propagate
• Disadvantages:
– Repeated plaintext blocks produce repeated ciphertext blocks
– It is possible to modify the order of the blocks or eliminate them
– Padding of the last block is neccesary
• E.g.: add zero bytes and a last byte reporting #padding_bytes
78
Sergio Pastrana
ECB mode insecurity
79
Sergio Pastrana
Cipher Block Chaining (CBC). Encryption
80
Sergio Pastrana
Cipher Block Chaining (CBC). Decryption
81
Sergio Pastrana
Counter mode (CTR)
• Uses a counter of the size of a block (n)
82
Sergio Pastrana
Counter mode (CTR). Encryption
• Simplicity and random access
83
Sergio Pastrana
Counter mode (CTR). Decryption
84
Sergio Pastrana
CTR. Advantages
85
Sergio Pastrana
Block ciphers. Very simple BC with CTR OM
• Key = 4
• Plaintext message:
HI! → in ASCII!
• Nonce = 6
• Encrypted text? (in Hex)
87
Sergio Pastrana
Confidentiality operation modes. Robustness
Source: ECRYPT-CSA. Algorithms, Key Size and Protocols Report (2018), 28 February 2018
https://www.ecrypt.eu.org/csa/documents/D5.4-FinalAlgKeySizeProt.pdf
88
Sergio Pastrana
Contents
89
Sergio Pastrana
Asymmetric encryption
• Asymmetric/public key/two keys
– Uses pairs of keys: (public key, private key)
– Public key (kU)
• Known by everyone (it’s public!)
• Used by a sender A to encrypt messages to B, the owner of the
key pair
– Private key (kV)
• Known only by the owner of the key pair
• Used by owner to decrypt messages sent by anyone to him/her
Sergio Pastrana
Asymmetric encryption
• Computational infeasibility assumption
– It is impossible to perform an exhaustive search
– Key size must be large enough
• Based on hard mathematical problems
– Not belonging to class P (polynomial time)
• Make use of trapdoor one-way function
– Prime factorization (large numbers)
– Discrete logarithm
• They are slow in comparison with symmetric
cryptosystems
Sergio Pastrana
Asymmetric encryption
• Notion of asymmetric encryption (Diffie-Hellman, 1976)
ku kv
M ENCRYPT C DECRYPT M
92
Sergio Pastrana
Asymmetric encryption. Algorithms
93
Sergio Pastrana
RSA
• Bob:
1. Chooses pB, qB (very big primes, private)
2. Computes nB = pB · q B
3. Calculates φ(nB) = φ(pB) · φ(qB)
4. Chooses eB ∈ Z+ / m.c.d. (eB, φ(nB))=1
5. Calculates dB such that eB · dB = 1 mod. φ(nB)
94
Sergio Pastrana
RSA
• Alice sends an encrypted message M to Bob
C=MeB mod. nB
A B
95
Sergio Pastrana
RSA
• Proof:
• So Cd mod. n=M
96
Sergio Pastrana
RSA. Cryptanalysis
• Brute force
• Mathematical attacks (factoring the product of two primes)
• Side-channel attacks (e.g., Timing)
• Chosen ciphertext attacks
– RSA property: E(KU, M1) x E(KU, M2) = E(KU, [M1 x M2])
– Given C, we want to decrypt it
• Compute X = (C x 2e ) mod n
• Submit X as chosen ciphertext to obtain decryption Y = Xd mod n
• X = (C x 2e ) mod n = (Me mod n) x (2e mod n) = (2M)e mod n
• Therefore Y = 2M mod n, from which we can deduce M
– Recommended: Optimal Asymmetric Encryption Padding (OAEP)
97
Sergio Pastrana
RSA. Cryptanalysis
• RSA security is based on problem of factoring large integers =
product of two primes
• In order to compute d = inv [e, φ(n)]
– It is needed to compute φ(n) = (p-1)(q-1)
– So it is needed to know p and q (factorization of n)
• RSA factoring challenge
– https://en.wikipedia.org/wiki/RSA_Factoring_Challenge
– RSA-768 (768 bits, 232 decimal digits): 12/12/2009
– RSA-230 (762 bits, 230 decimal digits): 15/08/2018
• Modulus recommended length
– At least 2048 bits (NIST 2016) or 3072 bits (ECRYPT-CSA 2018)
98
Sergio Pastrana
Wrap up. Key length with similar security
Sergio Pastrana
Wrap up. Symmetric cryptography
• Advantages • Disadvantages
– Symmetry – Need a secure
– High speed channel for sharing
the key
– Huge number of keys
for large number of
users
100
Sergio Pastrana
Wrap up. Public key cryptography
• Advantages • Disadvantages
– No need of a secure – Asymmetry
channel – Very low speed
– Simpler key – Public keys need
management for large authentication
number of users (1
public key per user +
own private key)
10
1 Sergio Pastrana
Wrap up. Hybrid encryption scheme
• Combine symmetric and asymmetric encryption schemes to
overcome their disadvantages
– A choses KS, symmetric key for this session
– A encrypts M using Ks, and sends a first ciphertext CM to B
CM = ESYM (KS, M)
– B will need KS to decrypt ciphertext 🡪
– A encrypts KS using B’s public key KU,B and sends this second
ciphertext CS to B
CKS= EASYM(KU,B, KS)
• How does B decrypt M? B only knows his own private key
– First decrypts CKS using his private key KV,B to obtain KS
– Then decrypts CM using KS, the symmetric key just decrypted in
previous step
102
Sergio Pastrana
COURSE DATA PROTECTION & CYBERSECURITY