Modern Cryptography

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

Assignment 8

Due on 25/04/2023

Problem(s)

Part 1

  1. Write a function extendedGCD(a, b) to find GCD (Greatest Common Divisor) of a, and b using the Extended Euclidian Algorithm
    • The function must return three values, i.e., GCD, x, and y
    • Run your code to find the GCD for the following three sets of (a, b):
      • (91,11)
      • (391,299)
      • (4324525,96)
      • (25252525,10101000)
      • (23964896,743288)

Part 2

  1. Write a function getNkeys(seed, N) that takes 2 values as input and generates N different binary strings of 48-bits. The function should follow the constraints given below:
    • seed should be a 64-bit binary string and keep N = 3
    • Initially, the seed MUST be converted to a 56-bit binary string K0, using compressM2N() done in Lab 7 and find (X0, Y0)
    • To generate key-i (Ki) of N, use shiftNmerge(data,N), and PC_M2N(data, M, N) to find subsequent (Xi, Yi) and Ki (Lab 8)
    • i represents the sequence number of key, that must depend upon the previous X and Y
    • Use the same PC table for every round as used during Lab 8

Back to Homepage