Beruflich Dokumente
Kultur Dokumente
of third parties (called adversaries). The original message is encrypted before sending it to
receiving party who can decrypt it to obtain the original message with the use of key but the
third party listening over the unsecured network cannot obtain the original message without that
shared key. The basic idea behind encryption and decryption is that the message becomes useless
to anyone who cannot decrypt it. Depending on the type of key used, cryptography is subdivided
into two types.
1) Private key cryptography or Symmetric Cryptography
2) Public key cryptography or Asymmetric Cryptography
Private Key Cryptography: Also known as Symmetric cryptography, its the type of
cryptography that use the same cryptographic keys for both encryption of plaintext and
decryption of ciphertext. The keys may be identical or there may be a simple transformation to
go between the two keys. Examples of Symmetric Cryptography include DES, AES, and
classical cryptography such as hill cipher, block cipher etc.
Choose p = 3 and q = 11
Compute n = p * q = 3 * 11 = 33
Compute z = (p - 1) * (q - 1) = 2 * 10 = 20
Choose e such that 1 < e < z and e and n are coprime. Let e = 7
The encryption of m = 2 is c = 27 % 33 = 29
2> Alice and Bob each separately choose 512-bit random numbers, SA and SB.
the private keys
3> Alice and Bob compute public keys:
TA = gSA mod p ; TB = gSB mod p ;
4> Alice and Bob exchange TA and TB in the clear
5> Alice computes (TB)SA mod p
6> Bob computes (TA)SB mod p
7> shared secret:
S = (TB)SA mod p = = gSASB mod p = (TA)SB mod p
Even though Eve might sniff TB and TA, Eve cannot easily determine S.
Diffie-Hellman: Example
p = 11 and g = 5
Private keys: SA = 3 and SB = 4
Public keys:
TA = gSA mod p = 53 mod 11 = 125 mod 11 = 4
TB = gSB mod p = 54 mod 11 = 625 mod 11 = 9
Exchange public keys & compute shared secret:
(TB)SA mod p = 93 mod 11 = 729 mod 11 = 3
(TA)SB mod p = 44 mod 11 = 256 mod 11 = 3
Shared secret:
3 = symmetric key