File Encryption & Decryption Project -
Understanding Notes
■ How the Project Works
This project is a browser-based file encryption and decryption tool using HTML, JavaScript, and the
Web Crypto API. Encryption Process: - User selects a file and enters a password. - Password is
converted into a cryptographic key using PBKDF2 (100,000 iterations, SHA-256). - Random Salt
(16 bytes) and IV (12 bytes) are generated. - File is encrypted with AES-GCM (256-bit key). -
Encrypted file structure: [Salt (16 bytes)] + [IV (12 bytes)] + [Encrypted Data]. - Encrypted file is
downloaded with '.enc' extension. Decryption Process: - User selects encrypted file and provides
the same password. - Salt and IV are extracted from the file. - PBKDF2 regenerates the
cryptographic key. - File is decrypted using AES-GCM. - If password matches → File is restored. - If
password is incorrect → Error message is shown.
■ Sharing Encrypted Files Across Devices
- The encrypted file can be safely shared via USB, email, or cloud. - The receiving device opens the
HTML tool and selects the file. - The same password is required to decrypt successfully. - Without
the correct password, the file remains unreadable.
■ Where is the Password Stored?
- The password is never stored on disk or server. - It exists only temporarily in browser memory
while encrypting or decrypting. - Once the browser is closed or refreshed, the password is gone. -
This increases security but makes remembering the password essential.
■ Advantages
1. Strong security: AES-256 GCM + PBKDF2 with SHA-256. 2. Entirely browser-based (no server
or cloud required). 3. Encrypted files are portable and safe to share. 4. Easy to use and lightweight.
■ Disadvantages
1. If the password is forgotten, the file cannot be recovered. 2. Password must be re-entered each
time (no storage). 3. Large files may take longer to encrypt/decrypt in the browser. 4. Depends only
on password strength (no multi-factor security). 5. Encrypted files must be managed manually by
the user.
■ Summary
This project works as a secure, browser-based 'file locker.' Files are encrypted with a password and
can be shared safely across devices. Decryption only succeeds if the same password is provided.
The system is highly secure but requires careful password management by the user.