Git Product home page Git Product logo

fcrypt's Introduction

fcrypt - A simple file encryption CLI

fcrypt is a simple CLI for file encryption using passwords written in C.

Building

fcrypt uses CMake as its build system. The project can be built in the standard way, i.e

$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=on -G Ninja ..
$ ninja
$ ./fcrypt --version

Currently, the patch command is needed to build. You won't need it when libressl updates to v3.9.3.

It's highly recommended to use ThinLTO (DCMAKE_INTERPROCEDURAL_OPTIMIZATION=on) during the build as this greatly reduces the executable size.

There are a couple variables used during the build, listed here:

Variable Default Description
USE_SANITIZERS off Enables the use of ASan and UBSan.
BUILD_X86_64_V3 off Enables x86-64-v3 optimizations for Argon2.

Testing

Tests are written in Lua. It's built automatically with the project. To run tests:

$ ctest

Usage

Encrypting a file

$ fcrypt -p "my very secure password" -i somefile.txt -o somefile.txt.enc

Decrypting a file

$ fcrypt -dp "my very secure password" -i somefile.txt.enc -o somefile.txt.dec

Details

fcrypt uses AES-256-CTR or ChaCha20 for the encryption itself, Blake3 for authentication, and argon2 for key derivation. The format is (informally) described below.

First, an 8-byte magic header is written to the file. Then, the encrypted file data. Finally, the Argon2 salt (32 bytes) and Blake3 MAC (32 bytes) is written to the end of the file.

Future plans

  • Add standalone key-generation (generate and wrap key with a password)
  • Add more features, like signing/verifying and hashing
  • Add public-key encryption support
  • Allow multiple keys to decrypt a file
  • Rewrite in Rust

fcrypt's People

Contributors

rfl890 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.