项目作者: vsencrypt

项目描述 :
Very strong encryption to keep your file securely.
高级语言: C
项目地址: git://github.com/vsencrypt/vsencrypt.git
创建时间: 2019-01-04T23:26:45Z
项目社区:https://github.com/vsencrypt/vsencrypt

开源协议:MIT License

下载


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

  1. make
  2. make test

Usage

  1. vsencrypt [-h] [-v] [-q] [-f] [-D] -e|-d [-a cipher] -i infile [-o outfile] [-p password]
  2. DESCRIPTION
  3. Use very strong cipher to encrypt/decrypt file.
  4. The following options are available:
  5. -h Help.
  6. -v Show version.
  7. -q Quiet. No error output.
  8. -f Force override output file if already exist.
  9. -D Delete input file if encrypt/decrypt success.
  10. -e Encryption.
  11. -d Decryption.
  12. -c Encryption cipher, used in encryption mode(-e) only.
  13. Available ciphers:
  14. chacha20 256bit, faster than AES 256.
  15. salsa20 256bit, faster than AES 256.
  16. aes256 AES 256bit in CTR mode.
  17. aes256_chacha20 aes256 then chacha20 (default cipher).
  18. aes256_salsa20 aes256 then salsa20.
  19. chacha20_aes256 chacha20 then aes256.
  20. salsa20_aes256 salsa20 then aes256.
  21. -i <infile> Input file for encrypt/decrypt.
  22. -o <infile> Output file for encrypt/decrypt.
  23. -p Password.
  24. EXAMPLES
  25. Encryption:
  26. vsencrypt -e -i foo.jpg -o foo.jpg.vse -p secret123
  27. vsencrypt -e -i foo.jpg # will output as foo.jpg.vse and ask password
  28. Decryption:
  29. vsencrypt -d -i foo.jpg.vse -d foo.jpg -p secret123
  30. vsencrypt -d -i foo.jpg.vse # will output as foo.jpg and ask password

Design

File Format

  1. +++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. | version | header | encrypted data... |
  3. +++++++++++++++++++++++++++++++++++++++++++++++++++++

Version

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

Header

File header is determined by version.

Version 1 Header

  1. ++++++++++++++++++++++++++++++++++++++++++++++++++++++
  2. | cipher(1) | salt(16) | iv(16) | mac(16) |
  3. ++++++++++++++++++++++++++++++++++++++++++++++++++++++
  • 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

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

License

MIT. see LICENSE.txt

References