Modern Cryptography

Practicals for M.Sc. CS students | (M3022201)

Lab 12 (17/05/2023)

Problems for lab session:

Practicals

Part 1

1. Implement RSA for ‘textual’ data encryption and decryption, keeping following instructions in account:

  • Convert char. string to binary string before the encryption
  • Unencrypted numbers (representing textual string block) should be represented in N-2 bits
  • Encrypted numbers (representing ciphertext’s block) should be represented in N bits
  • The ciphertext should be a binary string
  • You must demonstrate the both encryption and decryption

* N represents the length of n in RSA key-pair.

Part 2

1. Diffie-Hellman key exchange algorithm

  • Consider a prime number q
  • Consider primitive root (generator) alpha of q such that alpha < q
  • Take xPrv and find xMap = alpha ^ xPrv mod q. Similarly find yMap using yPrv.
  • Find K1 such that K1 = yMap ^ xPrv mod q for user X. Similarly find K2
  • Check for the equality of K1 and K2.

Back to Homepage