LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

bcrypt

Encrypt and decrypt files using Blowfish

TLDR

Encrypt a file (creates file.txt.bfe, removes the original)
$ bcrypt [file.txt]
copy
Decrypt a file (any .bfe input is decrypted)
$ bcrypt [file.txt.bfe]
copy
Encrypt but keep the original file
$ bcrypt -r [file.txt]
copy
Encrypt without compressing first
$ bcrypt -c [file.txt]
copy

SYNOPSIS

bcrypt [-orc] [-s N] file...

DESCRIPTION

bcrypt is a cross-platform file encryption utility using the Blowfish cipher. Files are encrypted with a passphrase and saved with a .bfe (Blowfish Encrypted) extension. Any file ending in .bfe is assumed to be encrypted and is decrypted; all other input files are encrypted.By default bcrypt compresses each input file before encryption, removes the input file after it is processed successfully, and overwrites the original with random data first to hinder recovery. Passphrases may be 8 to 56 characters; the key is always hashed internally to the 448-bit maximum supported by Blowfish.

PARAMETERS

-o

Print output to standard out (implies -r).
-r
Do not remove input files after processing.
-c
Do not compress files before encryption.
-s N
Overwrite input files with random data N times before deleting (default 3).

WORKFLOW

$ # Encrypt (creates file.txt.bfe, removes file.txt)
bcrypt file.txt

# Decrypt (restores file.txt)
bcrypt file.txt.bfe

# Encrypt but keep the original
bcrypt -r file.txt
copy

INSTALL

sudo dnf install bcrypt
copy
brew install bcrypt
copy

CAVEATS

Older tool with limited maintenance. The passphrase resides in memory during operation. Blowfish has largely been superseded by AES, so consider gpg or ccrypt for modern needs. Forgetting the passphrase makes the data unrecoverable.

HISTORY

bcrypt was written by Johnny Shelley as a lightweight, portable file encryption tool. It uses Paul Kocher's implementation of the Blowfish cipher, which was designed by Bruce Schneier in 1993. This file utility is unrelated to the bcrypt password-hashing function of the same name.

SEE ALSO

gpg(1), openssl(1), ccrypt(1), age(1)

RESOURCES

Copied to clipboard
Kai