Project Task: Secure these data using client-side encryption and data authentication. Specifically, write a program which on the command “Encrypt” does the following:
1. Encrypts a text file on a randomly generated key using AES-256 in the counter mode (CTR).
2. Appends to the resulting ciphertext its HMAC-SHA256 authentication tag (you will need another random key for the MAC).
3. Uploads the ciphertext alongs with the tag to Google Drive.
On the command “Decrypt”, the program does the following:
1. Downloads the file and the tag from Google Drive.
2. Verifies the MAC, and outputs a “Ciphertext Invalid!” error, if the tag is invalid and stops.
3. Decrypts the ciphertext and outputs the resulting text file.
In the above, the keys must be generated on a user-defined password via key derivation function (take PBKDF2).
Feel free to use the programming language of your choice. Python is recommended.
Also, feel free to use existing implementations of cryptographic primitives (you are not expected to implement encryption and MAC by yourselves).