Linux file encryption utility written in C using libsodium
- Current version
libsodium-file-crypter version 1.0.0
This project was created using CLion
For now only Linux is supported
This program has been compiled and tested on Fedora 27
[root@localhost d3v]# uname -a
Linux localhost.localdomain 4.14.8-300.fc27.x86_64 #1 SMP Wed Dec 20 19:00:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Libsodium installation instructions from the official docs
- Download source (latest stable preferred) tarball from HERE
- Unpack
tar -xvf LATEST.tar.gz
cd libsodium-stable/
./configure
make && make check
sudo make install
or executemake install
after switching withsu
to root- You may want to run
ldconfig
that creates the necessary links and cache to the most recent shared libraries
On Fedora 27
- Libraries will be installed in
/usr/local/lib/
- Header files will be located in
/usr/local/include/
Refer to official docs for installation HERE
- Download binary from HERE
- Compile from source. Sources available on download page HERE
./bootstrap
make
sudo make install
or executemake install
after switching withsu
to root
- Install from repository
- For Fedora and similar distributions run
dnf install cmake
after switching withsu
to root
- For Fedora and similar distributions run
- Make sure all requirements like libsodium and cmake are satisfied
- Clone git repository with
git clone https://github.com/jpiechowka/libsodium-file-crypter.git
- Switch to the downloaded repository directory
cd libsodium-file-crypter
- Run
cmake .
- Run
make
To see help message run with -?
or --help
options
Usage: libsodium-file-crypter [OPTION...] FILE PASSWORD
Linux file encryption utility written in C using libsodium
-d, --decrypt Decrypt the specified file. Specifying operation
mode is mandatory for program to run
-e, --encrypt Encrypt the specified file. Specifying operation
mode is mandatory for program to run
-f, --force Force overwrite of output file if it already
exists
-o, --output=FILE Specify output file instead of default:
output.crypt
-v, --verbose, --debug Increase verbosity - show debug messages
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
Report bugs to https://github.com/jpiechowka/libsodium-file-crypter/issues.
- FILE - mandatory argument specifying file to operate on
- PASSWORD - mandatory argument specifying password used to perform encryption/decryption
- [-e/--encrypt] or [-d/--decrypt] - specify mode of operation. One of this options in mandatory for program to work.
- If no output file is provided with [-o/--output] default output file will be used
Run with --usage
option
Usage: libsodium-file-crypter [-defv?V] [-o FILE] [--decrypt] [--encrypt]
[--force] [--output=FILE] [--verbose] [--debug] [--help] [--usage]
[--version] FILE PASSWORD
- Encrypting example plaintext.txt file using
super-secret-pass-123
as password./libsodium-file-crypter -v -e -o encrypted.txt plaintext.txt super-secret-pass-123
- -v for verbose mode
- -e to encrypt the specified file
- -o encrypted.txt to provide output file path
- plaintext.txt is the file to encrypt
- super-secret-pass-123 is the password provided
- Decrypting previously encrypted file
./libsodium-file-crypter -v -d -f -o plaintext.txt encrypted.txt super-secret-pass-123
- -v for verbose mode
- -d to decrypt the specified file
- -f option is used to force overwrite of the previously existing output file
- -o plaintext.txt to provide output file path. Note that this file path is the same as the old plaintext.txt file we encrypted before
- encrypted.txt is the file to decrypt
- super-secret-pass-123 is the password provided
- Investigate how to generate and store salt when using Argon2 for file encryption/decryption
- Implement generating salt and storing it somehow for file encryption/decryption purposes