Don’t trust password managers? Well you can encrypt that txt file full of complicated passwords and give it a master password that hopefully only you will know about.
Encrypting a File with Explicit Cipher:
gpg --symmetric --cipher-algo AES256 file.txt
In this example, AES256 is used as the cipher algorithm, providing strong encryption.
To further enhance security, you can also add the --s2k-cipher-algo, --s2k-digest-algo, and --s2k-mode options for passphrase hashing. For example:
Enhanced Security Example:
gpg --symmetric --cipher-algo AES256 --s2k-cipher-algo AES256 --s2k-digest-algo SHA512 --s2k-mode 3 file.txt
Here’s a breakdown of the options used:
--cipher-algo AES256: Specifies the symmetric encryption algorithm (AES256 in this case).--s2k-cipher-algo AES256: Specifies the cipher algorithm for the passphrase-to-key conversion.--s2k-digest-algo SHA512: Specifies the hash algorithm used for passphrase-to-key conversion.--s2k-mode 3: Iterated and salted passphrase-to-key conversion.
Remember, the goal is to balance security with usability. Stronger encryption and hashing algorithms may increase security but could also impact performance.
When decrypting, GPG will automatically use the appropriate algorithms based on the information stored in the encrypted file.
Feel free to adjust the options based on your security requirements, and always ensure that the recipients of the encrypted file can decrypt it with the chosen settings.
2. CCRYPT COMMAND
Another super easy method is to use ccrypt. It’s simple and fast and if you forget the password there is no way to decrypt or crack ope the file AFAIK.
To encrypt:
ccrypt -e my_file
A file named my_files.cpt will be created
To decrypt:
ccrypt -d my_files.cpt
And you get the original file back.