Skip to content

ComprosoftCEO/AESFileEncryption

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AES File Encryption (AFE)

C utility to encrypt a file using AES-256


Compiling

This program is designed to work with the cross-platform IDE Code::Blocks. For Windows platforms, be sure to download and install Code::Blocks with MinGW included.

Before compiling, download and install the GNU Realine Library:

  • Debian Linux: sudo apt-get install libreadline6 libreadline6-dev
  • Fedora Linux: sudo yum install libreadline6 libreadline6-dev
  • Windows: Download Readline for Windows.
    1. Copy the contents of the "include" folder into <CodeBlocks>\MinGW\include
    2. Copy the contents of the "lib" folder into <CodeBlocks>\MinGW\lib
    3. Copy the runtime binaries (history5.dll and readline5.dll) into the same folder as the target application (found in AesFileEncryption\bin\Debug or AesFileEncryption\bin\Release)

When compiling on Windows, you might need to define the constant _WIN32. In the Code::Blocks toolbar, go to Settings -> Compiler Settings -> Global Compiler Settings. Under the tab #defines, add the line _Win32.

Open AesFileEncryption.cbp in Code::Blocks to edit the project and compile the code.


Usage

afe (-e | -d | -v) [-r] <in-file> [out-file]

  • -e = Encrypt file
  • -d = Decrypt file
  • -v = Verify encryption of <in-file> to confirm that password is correct
  • -r = Remove the backup file (only if [out-file] isn't specified)

If [out-file] isn't specified, then encryption or decryption overwrites <in-file>. However, a backup is created named <in-file>.bak.


Credits

  • AES implementation is from the repository tiny-AES-c by kokke.
  • SHA-256 is from the repository crypto-algorithms by Brad Conte (B-Con).