This project implements the AES-128 Encryption and Decryption in C, supporting different modes of operation. Follow the steps below to run and interact with the program.
- Open
main.c
. - Enter the key in 128-bit Hex String format (Default:
YELLOW SUBMARINE
). - Initialization Vector (IV) is generated randomly for each encryption, so you have no control over it.
- The encrypted output file will be saved in the same directory (Default:
encrypt.bin
). - For verification, the same encrypted file will be decrypted (Default:
decrypt.bin
).
- Ensure that
gcc
andmake
are installed on your system. - Open a terminal and navigate to the project directory.
- Run
make
to build the program. - Run the program using
./aes
. - When prompted:
- Enter the name of the file you want to encrypt.
- Select the mode of operation for encryption.
- Select the mode of operation for decryption.
To install gcc
and make
on Ubuntu:
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install make
If make
command is not working, then execute the program manually by :
gcc -o aes main.c run/prog/utils.c run/prog/algo.c run/prog/enc_dec.c modes/prog/enc/cfb_enc.c modes/prog/dec/cfb_dec.c modes/prog/enc/ofb_enc.c modes/prog/dec/ofb_dec.c modes/prog/enc/ecb_enc.c modes/prog/dec/ecb_dec.c modes/prog/enc/cbc_enc.c modes/prog/dec/cbc_dec.c