CNS
CNS
calculated by user A=(aXBmod q)Xmod q=(axB)XA(mod q)->By rules of modular arithmetic=aXB mod q=(aXA)XBmod qk =(YB)XAmod q->calculated by user A=(aXBmod q)Xmod q=(axB)XA(mod q)->By rules of modular arithmetic=axB mod q=(axA)XBmod gk=(axAmod q)XBmod q Diffie Hellman key Exchange AlgorithmQl 6. Write the differences between conventional encryption and public key encryption. (P4 - Appeared 1 Time) (3-7 Marks) Ans: Conventional encryption Public key encryption. It is a type of cryptographic system which uses a single key to both encrypt the message and decrypt it It is a type of encryption scheme which instead of a single key iuses a pair of keys to encrypt the message and decrypt it. The same secret key is shared by the sender and the recipient The public can be shared freely to anyone while the private key Page no - 62 Handcrafted by Engineers | P - Priority and must be kept secret at all times is kept secret and is known only to the recipient. Conventional encryption algorithms are generally faster because they do not require as many CPU cycles as public key encryption Public key encryption schemes are typically substantial slower than conventional encryption algorithms. Itis less secure because the same secret key is shared by both the sender and the recipient. It is more secure because the secret key is only known to the receiver and there are infinite numbers of possibilities for keys.Q8. explain Eigamal Digital signature Scheme. - Module No 11| (4M)(P2-Appeared 3 time) (3-7 marks) Ans Page no- :As with Elgamal encryption, the global elements of Elgamal digital signature are a prime number q and a, which is a primitive root of q. User A generates a private/public key pair as follows. 1. Generate a random integer XA, such that 1 6 XA 6 q- 1. 2. Compute YA = aXA mod q. 156 Handcrafted by Engineers I P - Priority 3. A’s private key is XA; A's pubic key is {q, a, YA}. To sign a message M, user A first computes the hash m = H(M), such that m is an integer in the range 0..m..q-1LA then forms a digital signature as follows. 1. Choose a random integer K such that 1... K ..q- land ged(k, q-1) = 1. Thatis, K is relatively prime to q - 1 2. Compute $1 = akKmod q. Note that this is the same as the computation of Cl for Elgamal encryption. 3, Compute K-] mod (q - 1). That is, compute the inverse of K modulo q - 1. 4, Compute S2 = K-1 (m - XASI)mod (q ~ 1). 5. The signature consists of the pair (SI, $2). Any user B can verify the signature as follows. 1. Compute V1 = am mod q. 2. Compute V2 = (YA) SI (S1) $2 mod q. The signature is valid if V1 = V2. Let us demonstrate that this is so. Assume that the equality is true. Then we have am mod q = (YA) SI (SI) $2 mod q assume VI = V2am mod q = AXASI aKS2 mod q substituting for YA and $1 am-XA Sl mod q = aKS2 mod q rearranging terms m - XASI K KS2 mod (q - 1) property of primitive roots m ~ XASI K KK-1 (m - XASI) mod (q - 1) substituting for $2 For example, let us start with the prime field GF(19); that is, q = 19. It has primitive roots {2, 3, 10, 13, 14, 15} We choose a = 10.Q2. Explain one time pad cipher with an example. (P4 - Appeared 1 Time) (3-7 Marks) Ans: One-time pad cipher : One-time pad cipher is a type of Vignere cipher which includes the following features - © [tis an unbreakable cipher. * The key is exactly the same as the length of the message which is encrypted. * The key is made up of random symbols. Page no - 21 Handcrafted by Engineers | P - Priority * As the name suggests, the key is used one time only and never used again for any other message to be encrypted Due to this, encrypted messages will be vulnerable to attack for a cryptanalyst. The key used for a one-time pad cipher is called pad, s it is printed on pads of paper. The key is unbreakable owing to the following features ~ * The key is as long as the given message. * The keys truly random and specially auto-generated. © Key and plain text calculated as modulo 10/26/2. * Each key should be used once and destroyed by both sender and receiver. * There should be two copies of the key: one with the sender and other with the receiver. * Encryption: To encrypt a letter, a user needs to write a key underneath the plaintext. The plaintext letter is placed on the top and the key letter on the left. The cross section achieved between two letters is the plain text. Itis described in the example below © Plain text: THIS IS SECRET o OTP-ket: XVHE UW NOPGDZ © Cipher text: QCPW CO FSRXHS, © In groups: QCPWC OFSRX HS © Decryption: To decrypt a letter, the user takes the key letterQ3. Explain Ditfie Hellman key exchange algorithm. (P4 - Appeared I Time) (3-7 Marks) Ans: Diffie-Hellman algorithm- The Diffie-Hellman algorithm is being used to establish a shared secret that can be used for secret communications while exchanging data over a public network using the elliptic curve to generate points and get the secret key using the parameters. For the sake of simplicity and practical implementation of the algorithm, we will consider only 4 variables: one prime P and G (a primitive root of P) and two private values a and b. P and G are both publicly available numbers. Users (say Alice and Bob) pick private values a and b and they generate a key and exchange it publicly, the opposite person receives the key and from that generates a secret key after which they have the same secret key to encrypt. Example: Page no - Step I: Alice and Bob get public numbers P = 23, G = 9 Step 2: Alice selected a private key a = 4 and Bob selected a private key b = 3 Step 3: Alice and Bob compute public values Alice: x =(944 mod 23) = (6561 mod 23) = 6 45 Handcrafted by Engineers | P - Priority Bob: y = (9A3 mod 23) = (729 mod 23) = 16 Step 4: Alice and Bob exchange public numbers Step 5: Alice receives public key y =16 and Bob receives public key x = 6 Step 6: Alice and Bob compute symmetric keys Alice: ka = yAa mod p = 65536 mod 23 =9 Bob: kb = xAb mod p = 216 mod 23 = 9 Step 7: is the shared secret.