Question: Assignment Requirements 1 . Key Generation ( Key Manager Program - key _ manager.py ) :RSA Key Pair Generation for Each Operator ( Alice and
Assignment Requirements Key Generation Key Manager Program keymanager.py:RSA Key Pair Generation for Each Operator Alice and Bob:The key manager program will generate a pair of RSA public and private keys for both Alice and Bob.Saving Keys to Disk:Each RSA public and private key pair must be saved under filenames that reflect the operator's name eg alicepublickey.pem, bobprivatekey.pem File Sending Sender Program senderpy:Loading the Senders Private Key and Recipients Public Key:The program will load the senders private RSA key and the recipients public RSA key from the saved files.AESHMAC Key and IV Nonce Generation:Within the senderpy program, generate a random AES key, a random HMAC key, and an IV nonce using a secure random number generator. These values will be used for encrypting the file content and ensuring its integrity.Signing the Keys:The sender will sign the concatenated AES key, IV and HMAC key using their private RSA key to generate a signature. This signature will later verify the authenticity of the key materials. This is called the signature.Encrypting KeysIV using RSA:Concatenate the AES key, HMAC key, and IV then encrypt them using the recipients RSA public key to ensure only the recipient can decrypt and access the AES and HMAC keys. Save the encrypted key material to encryptedkeys.bin.File Content Encryption using AES:Concatenate the senders name, the original file content, a timestamp current time and the signature. Encrypt this data using AES in CTR mode with the generated AES key and IV We call this encryptedmessage.HMAC Generation:Calculate an HMAC over the encrypted message using the generated HMAC key. Save this HMAC to a file named hmacmessage.bin.Saving Encrypted Data:Save the encrypted message to a file named encryptedmessage.bin File Receiving Receiver Program receiver.py:Loading the Receiver's Private Key:The recipient eg Bob will load their private RSA key to decrypt the incoming encrypted data.Decrypting the AES Key, HMAC Key, and IV:The recipient will decrypt the AES key, HMAC key, and IV using their private RSA key from the encryptedkeys.bin file.HMAC Verification:The receiver will generate an HMAC of the encrypted file content and verify that it matches the HMAC provided in hmac.bin to confirm the integrity of the file content.File Content Decryption:Use the decrypted AES key and IV to decrypt the data, extracting the senders name, the file content, the signature, and the timestamp.Signature Verification:Load the senders public RSA key and verify the signature over the file content to ensure the integrity and authenticity of the communication Testing and Validation:Both the senderpy and receiver.py programs must include test cases that demonstrate successful encryption, decryption, HMAC verification, and signature verification of the file content.Include tests that cover cases where:The HMAC verification fails eg due to tampered data: adding one additional test case to cover the scenario where the encryptedmessage.bin file is tampered with, leading to failed HMAC verification.The signature verification fails eg due to incorrect senders public keyAll verifications pass, showing that the file contents integrity and authenticity are confirmed.Use numbers eg encryptedmessagebin, encryptedmessagebin, to distinguish between different cases.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
