Demo: https://diafygi.github.io/usb-file-crypt/usb_file_crypt.html
This is a standalone HTML file you can put on a USB drive and use it to encrypt and decrypt files on the drive without having to use any special software.
Copy usb_file_crypt.html to your USB drive.
On the system you have the files you want to encrypt and put on the USB drive:
- Open
usb_file_crypt.htmlin a web browser. - In the webpage's Encrypt section, select the file from the local filesystem you want to encrypt.
- Input an encryption password.
- Click "Encrypt".
- Wait for the file to encrypt (may take a bit for large files).
- When done encrypting, click the "Save to your USB drive" link.
- A file picker should pop up and you can save the encrypted
.encfile to your USB drive. - Close the webpage, unmount, and unplug your USB drive, and take it to the other system where you want to transfer the files.
On the system where you want to copy the files to:
- Open usb_file_crypt.html in a web browser.
- In the webpage's Decrypt section, select the file from the local filesystem you want to decrypt.
- Input an decryption password (same password as you used to encrypt it).
- Click "Decrypt".
- Wait for the file to decrypt (may take a bit for large files).
- When done decrypting, click the "Save to local filesystem" link.
- A file picker should pop up and you can save the decrypted file to your local filesystem.
- When you're done, you can simply close the webpage and delete the encrypted
.encfile on your USB drive.
As part of encrypting/decrypting, the webpage loads the entire file into memory, which can crash your browser if the file you're trying to encrypt/decrypt is larger than your systems free memory.
Browsers are limited to saving only one file at a time, so this tool is limited to encrypting/decrypting only single files. If you have a lot of files you want to transfer, I recommend creating a .zip file first and then encrypting that.
I made this because I couldn't find a way to make an encrypted USB drive that could be accessed using only default OS software on Windows, MacOS, and Linux. Each OS generally has a way to do encrypted USB drives, but they aren't cross-compatible with each other. So, for example, you can't make an encrypted USB drive on Ubuntu and be able to read it on stock Windows.
There's lots of special software you can use to do encrypted files on USB drives, but using it means each system has to have the software installed (which I don't want to have to do just to do ad-hoc file transfers securely).
So I made a small HTML file that you can keep on your USB drive, and then on whatever system you plug your USB drive into, you can open the HTML file in that system's browser and use it to encrypt/decrypt the files on your USB drive.
Released under MIT license.