Vikranth3140 / Encryption-Decryption-Tool

This Python tool provides a flexible way to encrypt and decrypt files using Stored Key Method and Password-Based Key Derivation.
MIT License
4 stars 5 forks source link

feat: Added Integrity Verification Through HMAC #11

Closed ARYPROGRAMMER closed 1 month ago

ARYPROGRAMMER commented 1 month ago

This PR Resolves the Issue#6

Major Changes :

  1. HMAC Generation (generate_hmac): An HMAC is created for the encrypted data using the encryption key.
  2. HMAC Verification (verify_hmac): During decryption, the HMAC of the encrypted content is compared with the stored HMAC to verify the file's integrity.
  3. File Structure:
    • When using password-based encryption, the salt is stored at the beginning of the file.
    • The encrypted content is followed by the HMAC, ensuring integrity.

With this feature, the script not only encrypts and decrypts files but also ensures that the data hasn’t been modified or tampered with during transmission or storage.

Vikranth3140 commented 1 month ago

Hey @ARYPROGRAMMER,

Thanks for the PR for #6. I have reviewed the PR and requested changes, please do the needful and revert back.