Giter Club home page Giter Club logo

vsencrypt's Introduction

vsencrypt

Build Status

A very strong encryption command line app to keep your file securely.

Supported ciphers:

  • chacha20 256bits.
  • salsa20 256bits.
  • aes256 AES 256bits in CTR mode.
  • chacha20_aes256
  • aes256_chacha20 default cipher.
  • salsa20_aes256
  • aes256_salsa20

Support Platforms

  • Mac OS
  • Linux
  • Windows

Build

make
make test

Usage

vsencrypt [-h] [-v] [-q] [-f] [-D] -e|-d [-a cipher] -i infile [-o outfile] [-p password]

DESCRIPTION
Use very strong cipher to encrypt/decrypt file.

The following options are available:

-h Help.

-v Show version.

-q Quiet. No error output.

-f Force override output file if already exist.

-D Delete input file if encrypt/decrypt success.

-e Encryption.

-d Decryption.

-c Encryption cipher, used in encryption mode(-e) only.

    Available ciphers:

    chacha20         256bit, faster than AES 256.
    salsa20          256bit, faster than AES 256.
    aes256           AES 256bit in CTR mode.
    aes256_chacha20  aes256 then chacha20 (default cipher).
    aes256_salsa20   aes256 then salsa20.
    chacha20_aes256  chacha20 then aes256.
    salsa20_aes256   salsa20 then aes256.

-i <infile> Input file for encrypt/decrypt.

-o <infile> Output file for encrypt/decrypt.

-p Password.

EXAMPLES
Encryption:
vsencrypt -e -i foo.jpg -o foo.jpg.vse -p secret123
vsencrypt -e -i foo.jpg      # will output as foo.jpg.vse and ask password

Decryption:
vsencrypt -d -i foo.jpg.vse -d foo.jpg -p secret123
vsencrypt -d -i foo.jpg.vse  # will output as foo.jpg and ask password

Design

File Format

+++++++++++++++++++++++++++++++++++++++++++++++++++++
| version | header | encrypted data...              |
+++++++++++++++++++++++++++++++++++++++++++++++++++++

Version

1 byte. File format version. Current version is 0x1.

Header

File header is determined by version.

Version 1 Header

++++++++++++++++++++++++++++++++++++++++++++++++++++++
| cipher(1) |  salt(16)  |   iv(16)   |    mac(16)   |
++++++++++++++++++++++++++++++++++++++++++++++++++++++
  • 1 byte cipher algorithm.
  • 16 bytes salt for password.
  • 16 bytes iv for encryption/decryption.
  • 16 bytes mac (Message Authentication Code) of poly1305 used to verify the data integrity and the authenticity.

Version 1 header total size is 1(version) + 1(cipher) + 16(salt) + 16(iv) + 16(mac) = 50 bytes.

Crypto

Key derivation function is Argon2 which was selected as the winner of the Password Hashing Competition in July 2015.

Poly1305 is used as message authentication code (MAC). Poly1305 has been standardized in RFC 7539.

Static Check

clang setup for static analysis

export C_INCLUDE_PATH=`pwd`/src:`pwd`/src/argon2/include:`pwd`/src/argon2/src/blake2

License

MIT. see LICENSE.txt

References

vsencrypt's People

Contributors

mingchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vsencrypt's Issues

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.