项目作者: na-vural

项目描述 :
AES256 CBC File Enc/Dec
高级语言: C
项目地址: git://github.com/na-vural/AES256-CBC-File-Enc-Dec.git
创建时间: 2021-02-08T20:07:12Z
项目社区:https://github.com/na-vural/AES256-CBC-File-Enc-Dec

开源协议:Mozilla Public License 2.0

下载


AES256-CBC File Enc/Dec

This is the EHB110E final project. Aim is that encrypt one or more files into a single file using AES256-CBC and decrypt this single file by preserving relative pathways of the encrypted files.

Installation

Clone the repo and make all.

Usage

  1. AES256 CBC File Encryptor-Decryptor
  2. Encryption Usage: ./file_enc_dec -k [KEY] -e -o [OUTPUT FILE] -i [INPUT FILE(S)-DIR(S)]
  3. Decryption Usage: ./file_enc_dec -k [KEY] -d -i [INPUT FILE]
  4. -k [KEY] The key that is used in encryption and decryption.
  5. Key must be given in the first place.
  6. Key length should be 256 bit namely 32 byte.
  7. If key is less than 256 bit, than key padded with zero (ASCII zero not the '\\0')
  8. If key is greater than 256 bit, than program terminates.
  9. After the key parameter one of the two options must be specified, encryption or decryption:
  10. -e Encryption
  11. When encryption is choosen, -o [OUTPUT FILE] -i [INPUT FILE(S)-DIR(S)] must be given.
  12. In encryption, output file must be given first, than input files and dirs are specified.
  13. There must be one output file, but number of input files-dirs can be more than one in encryption.
  14. -d Decryption
  15. In decryption the given input file must not be more than one. And the input file must be
  16. encrypted with this program. Otherwise program terminates.
  17. -i [INPUT FILE(S)] Input file(s) specifier
  18. In encryption this specify files and dirs that will be encrypted into single file.
  19. In decryption this specify the file that will be decrypted. The file must be one that was encrypted with this program.
  20. -o [OUTPUT FILE] Output file specifier
  21. This option must be used only in encryption. And specify name of the output file that
  22. includes the encrypted files and dirs.

TODO

  • Output file option for decryption will be added.
  • Some tricks for faster encryption and decryption will be removed to make secure the algorithm.
  • To be compatible with fips-197, key expansion algorithm will be changed and expanded key will be stored as 4 by (NR256+1)4 matrix instead of (NR256+1)4 by 4 matrix.