Cryptography – Computer Networking

Cryptography – Computer Networking

Explanation:
Caesar Cipher : The Caesar cipher is the simplest and oldest method of cryptography. The Caesar cipher method is based on a mono-alphabetic cipher and is also called a shift cipher or additive cipher. The Caesar cipher is a kind of replacement (substitution) cipher, where all letter of plain text is replaced by another letter. It is a type of substitution cipher in which each letter in the plain text is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on.

Diffie-Hellman: Diffieâ€“Hellman key exchange is a method of securely exchanging cryptographic keys over a public channel and was one of the first public-key protocols as conceived by Ralph Merkle and named after Whitfield Diffie and Martin Hellman. The Diffieâ€“Hellman key exchange method allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure channel. This key can then be used to encrypt subsequent communications using a symmetric key cipher.

Explanation:
Step- 1. Choose two different random prime number p & q.
Step-2. Calculate n= pq.
Step-3. Calculate the totient: Ï•(n) = (p-1)(q-1).
Step-4. Choose an integer e such that 1< e < Ï•(n), e is co-prime to Ï•(n) i.e. e & Ï•(n) share no factors other than 1; gcd(e, Ï•(n))==1. e is released as the public key exponent
Step-5. Compute d to satisfy the congruence d*e ==1 mod(Ï•(n)). d is kept as the private key exponent.
Step-6. Computes the cipher text c=me mod n.
Â  Step-1. Two prime number p = 3, q= 11.
Step-2. N = p*q = 3*11 = 33.
Step-3. Ï•(n)= (3-1)*(11-1) = 2*10 = 20.
Step-4. d*e ==1 mod(Ï•(n)).
Â  Â  Â  Â  Â  7* 3==1 mod (20) , here value of e is 3.
Step-5. Cipher text c = me mod n
Â  Â  Â  Â  Â  Â  Â C = 193 mod 33
Â  Â  Â  Â  Â  Â  Â C = 6859 mod 33
Â  Â  Â  Â  Â  Â  Â C = 28
Â  Â  Â  Â  Â  Â  Â e(public key)=3
Cipher text c =28

error: Content is protected !!