I wanted to make a keyfile for added security in TrueCrypt. You may use any filetype you’d like, but to create a new layer of security, I made a pass-phrase and encrypted this into a file using bcrypt. The same approach may be used to encrypt any file you want, to share with a friend or send by e-mail. Just as long as the decrypter knows the password, you are good to go.
Bcrypt uses the Blowfish algorithm, and is available in the official Debian repo.
Encrypt
$ echo “pass-phrase” > keyfile
$ bcrypt keyfile
You will be asked to provide a password, and the encrypted file is created.
Decrypt
$ bcrypt keyfile.bfe
Provide the password used for encryption, and the file is converted back to the original ‘keyfile’.
[...] If, for some reason, you share your computer and grant others with root-privileges, they have access to your files, and setting permission is no longer enough! When sharing with your spouse, or you are one of them “I don’t keep anything from my girlfriend/boyfriend”-type – security is still something you are only concerned about when paying bills online. Though, when making a list of potential Christmas-present, file-encryption could come in handy. You don’t want her to ruin the surprise! Howto encrypt files: bcrypt – encrypt personal files. [...]