Modern Cryptography

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

Lab 14 (31/05/2023)

Problems for lab session:

Practicals

Quiz

1. Download the file and find the SHA-256 Hash

Part 1

1. Write a menu-driven program consisting of a function getHash(data, algo) to calculate the Hash of the provided data based on the following constraint:

  • data should be taken from the user
  • The hash value MUST be in hexadecimal format
  • Users may choose any one among the following 3 algorithms:
    • MD5
    • SHA224
    • SHA256

2. Write a function to take a password from the user and do the following:

  • Compute the MD5 hash of the password.
  • Ask for the password again (and compute the hash again).
  • Compare the both MD5 hash values, and provide the necessary feedback (by printing) accordingly.

Part 2

1. Write two scripts (server.py and client.py) using the socket programming in Python with the following properties:

  • Client: sends a request with -
    • username
    • password
    • type - Sign-up or Sign-in
  • Server: replies back with anyone among -
    • Registered successfully
    • Login successfully
    • Invalid password

* Basic programming in java (a Hwllo World program):


Back to Homepage