File | Date | Author | Commit |
---|---|---|---|
.gitignore | 2023-11-14 |
![]() |
[ccea15] add main.spec |
LICENSE | 2023-11-13 |
![]() |
[cfc862] first commit :-) |
README.md | 2024-03-19 |
![]() |
[2e7b60] Release V2.0.1 Update README |
Screenshot.png | 2024-01-05 |
![]() |
[aaf56b] add screenshot |
main.py | 2024-03-19 |
![]() |
[5ab657] Release V2.0.1 Increased salt length |
main.spec | 2023-11-14 |
![]() |
[32f8b6] update spec |
requirements.txt | 2024-04-22 |
![]() |
[56e897] update |
This File Encryption Program is a Python-based tool designed to securely encrypt and decrypt large files using a
password-derived key. It employs robust cryptographic methods, including PBKDF2 with SHA-256 for key derivation and
AES-GCM for encryption, making it suitable for processing large files efficiently.
.enc
extension and decrypts them back to their originalpip install -r requirements.txt
Navigate to the program's directory in the command line and use the following commands:
Encrypt a File:
python3 ./FileEncryptor encrypt <file_path>
This command encrypts the specified file and saves it with a .enc
extension.
Decrypt a File:
python3 ./FileEncryptor decrypt <file_path>.enc
This decrypts the specified .enc
file back to its original format.
750000
iterations in the key derivation process for enhanced security.Key Generation (generate_key function):
Key Encryption (encrypt_key_file function):
The encrypt_key_file function takes a key and a password as input.
The salt, nonce (a unique value used once), and the encrypted key are written to a file named "key". The salt and nonce are prepended to the encrypted key to ensure that they are available during decryption.
Key Decryption (decrypt_key_file function):
The decrypt_key_file function takes a password as input.
It then decrypts the encrypted key using AES-GCM and returns the decrypted key.
File Encryption (encrypt_file function):
The encrypt_file function takes a file path and a key as input.
Progress of the encryption process is displayed using the tqdm library, which provides a progress bar.
File Decryption (decrypt_file function):
The decrypt_file function takes a file path and a key as input.
Progress of the decryption process is displayed using the tqdm library.
Main Functionality (main function):
The main function serves as the entry point of the program.
Overall, the program provides functionality for securely generating keys from passwords, encrypting and decrypting files using those keys, and handling user input securely. It follows best practices for key management and encryption, making it suitable for protecting sensitive data.
The "key" file contains the encrypted master key
, which is derived from the user-provided password using a key derivation function (KDF) with a salt. This master key
is then used to encrypt and decrypt files using the AES-GCM symmetric encryption algorithm.
However, the master key itself cannot be directly used to decrypt files. Instead, it needs to be decrypted first using the correct password provided by the user. Once the master key
is successfully decrypted, it can be used to perform encryption and decryption operations on files.
This approach adds an additional layer of security because even if an attacker gains access to the encrypted master key
, they would still need the correct password to decrypt it and gain access to the actual encryption/decryption functionality.
In summary, the master key
serves as the key to unlock the encryption/decryption capabilities of the program, but it requires the correct password to be usable. Without the password, the master key
remains securely encrypted and unusable for decryption purposes.