Modern Cryptography

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

Assignment 2

Due on 14/03/2023

Problem(s)

Part-1:

Implement one of the following two algorithms (for Base64 characters except [+, /], i.e.,A to Z, a to z, and 0 to 9) as per the instructions:

  • Vernam-Vigenère Cipher: (i.e. a Vigenere Cipher with Key Length equal to message length) (odd roll numbers)
  • Vigenère Cipher: (even roll numbers)

Part-2:

Implement a code for launching the Padding Oracle Attack on a Cipher Block Chaining (CBC) algorithm with the following steps:

  1. Design CBC cipher
    • block size = key size = IV size = 3
    • Keep it specific to to the char. [0 to 9] (here, the datatype is ‘character,’ NOT int)
    • Use ‘0’ in case of padding
  2. Write a function to generate all possible sets of keys
    • Remember the key size
    • Write a function to automatically call decryption() for a given ciphertext bruteforcing the keys
  3. Write a function to generate all possible sets of IVs
    • Remember the IV size
    • Write a function to automatically call decryption() for a given ciphertext bruteforcing the IVs
  4. Implement the Padding Oracle Attack for ciphertext (given as input)

* Part 2 is a CHALLENGE question and stepwise marking will be done for the same!


Back to Homepage