Modern Cryptography

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

Lab 8 (19/04/2023)

Problems for lab session:

Practicals

Part 1

  1. Write a function shiftNmerge(data,N) splits data in two halves and performs a left-shift opration as follows:
  • data = a binary value
  • Split data in 2-halves (X0 and Y0) and perform a left-shift opration on each part for N number of bits to get (X1 and Y1)
  • Merge the previous output, i.e., X1 & Y1
  1. Write a function PC_M2N(data, M, N) that takes an M-bit input (data) and compresses into to N-bit:
  • The result MUST contain N bits, i.e., M-N bits are discarded
  • The permutation and compression is based on the table below (taken from Geeks for Geeks)
    Permutaion Choice table

Part 2

  1. Write a function to find GCD using Euclidean Algorithm

Back to Homepage