Modern Cryptography

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

Lab 5 (29/03/2023)

Problems for lab session:

Demo of Assignment-4…

Practicals

Use the following plaintext for encryption in the following questions:

Plaintext: 2210ModernCrypto

Part-1:

  1. Define a function LinearCongruentialGenerator() to generate Pseudo-Random Numbers (PRNs) with the following properties:
    • It MUST generate 8-digit PRNs
    • Seed should be your Roll Number
    • Generate 2 random numbers using LinearCongruentialGenerator()
  2. Create a function Compress_M2N(mDigitBinNum, M, N) to compress a given M-bit binary string to N-bit with the following constraints:
    • M > N
    • Must operate on binary-string of even length (for both M and N)
    • It should create and use a p X q size table (here p = # rows, q = # columns) for the number generation, where
      • q = 2^N
      • p * q = 2^M

Back to Homepage