Professional Documents
Culture Documents
Lecture 5
Public Key cryptography
0 1 2 3 4 5 6 7 8 9
0 0 1 2 3 4 5 6 7 8 9
1 1 2 3 4 5 6 7 8 9 0
2 2 3 4 5 6 7 8 9 0 1
3 3 4 5 6 7 8 9 0 1 2
4 4 5 6 7 8 9 0 1 2 3
5 6 7 8 9 0 1 2 3 4
5
6 6 7 8 9 0 1 2 3 4 5
7 7 8 9 0 1 2 3 4 5 6
8 8 9 0 1 2 3 4 5 6 7
9 9 0 1 2 3 4 5 6 7 8
V.E.S.I.T_M.C.A Nishi Tiku 7
Modular Arithmetic
Modular Multiplication
Example using mod 10 multiplication
1,3,7,9 considered good ciphers
perform 1-to-1 substitution of digits
5 is not e.g. 5*2 = 5*4 = 0 mod 10
In mod math, multiplicative inverse of x is the number by
which you would multiply x to get 1
1,3,7,9 have multiplicative inverses mod 10
(3-7, 1-1, 9-9)
Can be used as a cipher
1,3,7,9 are considered to be good ciphers because
relatively prime to n (10)
no common factors with n other than 1 e.g. 1,3,7,9 (mod
10)
relatively prime => multiplicative inverse
0 1 2 3 4 5 6 7 8 9
0 0 0 0 0 0 0 0 0 0 0
1 0 1 2 3 4 5 6 7 8 9
2
0 2 4 6 8 0 2 4 6 8
3 0 3 6 9 2 5 8 1 4 7
4 0 4 8 2 6 0 4 8 2 6
5 0 5 0 5 0 5 0 5 0 5
6 0 6 2 8 4 0 6 2 8 4
7 0 7 4 1 8 5 2 9 6 3
8 0 8 6 4 2 0 8 6 4 2
9 0 9 8 7 6 5 4 3 2 1
V.E.S.I.T_M.C.A Nishi Tiku 9
Modular Arithmetic
Modular Multiplication
Euclid’s Algorithm
mod n
given x & n, finds no. y such that x * y
0 1 2 3 4 5 6 7 8 9 10 11 12
0
0 0 0 0 0 0 0 0 0 0 0 0
1
2 1 1 1 1 1 1 1 1 1
1 2 4 8 6 2 4 6 6
3
1 3 9 7 1 3 9 1 1
4
1 4 6 4 6 4 6 6 6
5 1 5 5 5 5 5 5 5 5
6 1 6 6 6 6 6 6 6 6
7 1 7 9 3 1 7 9 1 1
8
1 8 4 2 6 8 4 6 6
9 1 9 1 9 1 9 1
V.E.S.I.T_M.C.A Nishi Tiku 1 1 12
Public Key Cryptography
RSA & ECC (encrypt.and DS)
Elgamal (DS)
Zero knowledge sys.(authentication)
Diffie Hellman (shared secret +secret key scheme)
RSA
Key length usually 512 bits
Plaintext size < key length
Cipher text size = key length
Usually used to encrypt a secret key which is then
used to encrypt message
Based on Modular Arithmetic
Step 2: Select e = 17
While data confidentiality has been the driver behind historical cryptography, digital
signatures could be the major application of cryptography in the years to come.
V.E.S.I.T_M.C.A Nishi Tiku 28
Digital signatures
an electronic signature that is:
2. uniquely linked to the signatory
3. capable of identifying the signatory
4. created using means under the sole control of the
signatory
5. linked to data to which it relates in such a way that
subsequent changes in the data is detectable
KS KV
Arbitrator
m
es
sa
S
ge
K
C
A
M
M
AC
eg
KS
sa
es
M
m
AC
KV
1
4
Signer KS KV
Verifier
V.E.S.I.T_M.C.A Nishi Tiku 33
True digital signatures
message
1
hash
function message
3
signature
hash
signature
2
Signature
signature key
algorithm
message
signature
1
2
hash
Verification
verification key function
algorithm
=?
3
Decision
V.E.S.I.T_M.C.A Nishi Tiku 36
RSA signatures with message recovery
RSA signaturesSigner
with message recovery
Verifier
message message
add remove
padding / 1 4 padding /
redundancy redundancy
signature
V.E.S.I.T_M.C.A Nishi Tiku 37
Digital Signature Algorithm
Although there have been many different proposals for digital
signature schemes, only two systems have thus far proved to be
fairly popular.
RSA digital signatures are one, and the other is a digital signature
scheme based on ElGamal that was proposed as the Digital
Signature Algorithm (DSA) and standardised by the U.S.
Government as the Digital Signature Standard.
The DSA is a digital signature with appendix, but it cannot be used as
a public key encryption system in the same way that RSA can be
– it is a dedicated digital signature scheme.
Step 1: Let p = 23
Public key is 9
Private key is 6
3 - Ciphertext C = (20 , 22 )
C2 / yk = (Myk) / yk = M mod p
V.E.S.I.T_M.C.A Nishi Tiku 44
ElGamal decryption: example
To decrypt C = (20 , 22 )
2 - Compute 22 / 16 = 10 mod 23
3 - Plaintext = 10
into a bit string suitable for use as, for example, a DES key.
Diffie-Hellman key exchange
The most commonly described implementation of DH key exchange uses the
keys of the ElGamal cipher system and a very simple function F.
gf (mod p) gb (mod p)