This Java project provides secure file encryption and decryption using a hybrid AES + RSA system.
- Main.java
Handles both encryption and decryption automatically.
- Encrypts all files in the
inputfolder using a generated AES key. - Encrypts the AES key with the Clientβs public RSA key.
- Computes a SHA-256 hash of the encrypted AES key for integrity verification.
- Stores the following in the
encryptedfolder:- AES-encrypted files (
.enc) - Encrypted AES keys (
.key.enc) - SHA-256 hash of AES keys (
.key.sha256)
- AES-encrypted files (
- Deletes the original files from
inputafter successful encryption. β
- Uses the Userβs private RSA key to decrypt AES keys.
- Verifies AES key integrity using the stored SHA-256 hash.
- Decrypts the encrypted files using the decrypted AES key.
- Outputs the decrypted files to the
outputfolder. - Deletes the encrypted files after successful decryption. β
SecureFileTransfer/
βββ input/ # π₯ Files to encrypt
βββ encrypted/ # π Encrypted files, keys, and hashes
βββ output/ # π€ Decrypted output files
βββ keys/
β βββ User/ # π§βπ» User private key
β βββ Client/ # π€ Client public key
βββ Main.java # π Handles encryption and decryption
βββ Encryptor.java # β¨ Optional separate encryptor
βββ Decryptor.java # β¨ Optional separate decryptor
- Place files you want to encrypt in the
input/folder. π₯ - Ensure the keys are correctly placed in
keys/Userandkeys/Client. π - Run
Main.javaβ it will automatically detect and:- Encrypt files if
input/contains files - Decrypt files if
encrypted/contains files
- Encrypt files if
- Check the
encrypted/oroutput/folders for results. π - Original files are deleted automatically after successful operations. ποΈ
Note: The project uses AES for file encryption and RSA for secure AES key exchange, with SHA-256 hash for integrity verification.