From 0eb50bce96da604aa6186ca7021074d70f469847 Mon Sep 17 00:00:00 2001 From: sameuric <78437091+sameuric@users.noreply.github.com> Date: Sat, 22 Mar 2025 14:50:30 +0100 Subject: [PATCH] Update README.md --- README.md | 56 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 31217ba..72e3f15 100644 --- a/README.md +++ b/README.md @@ -4,42 +4,66 @@ Advanced Encryption Standard (AES) implementation in C AES is the most widely adopted symmetric encryption standard nowadays. This repository contains an implementation in C of the AES-128 algorithm. The program takes two arguments: a 32-bytes hexadecimal string representing the 128-bit input block, and another 32-bytes hexadecimal string representing the 128-bit key. It then outputs the corresponding ciphertext in hexadecimal form. -![screenshot](https://github.com/user-attachments/assets/8173fe57-0254-48df-a4e8-ebc41d01ccd0) +![image](https://github.com/user-attachments/assets/900b8428-7ed6-4c77-9a9c-df00db352c40) -(Writing in progress) +Screenshot taken after building the project with the build.bat file. Installation ------------ -First install Python 3.13.2 or above. -Then, make sure you have the following Python packages installed: `requests`, `pynput`. - -You can install these packages with: +First make sure you have installed the GCC compiler v8.1.0 or above. +The `gcc --version` command should output: ``` -pip install requests pynput +gcc (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0 +Copyright (C) 2018 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` -Then, clone this repository and edit `keylogger.pyw` to add your own custom webhook URL at line 40. ---- -Double-click on `keylogger.pyw`. You will not see anything as the program starts in background. You can check if the program has successfully started with the following command: +Then, clone this repository in any location on your computer and double-click on `build.bat`. +You should now see the program's output. + + +Usage and test vectors +---------------------- + +The program takes two arguments: a 32-bytes hexadecimal string representing the 128-bit input block, and another 32-bytes hexadecimal string representing the 128-bit key. It then outputs the corresponding ciphertext in hexadecimal form. You can find some test vectors on the official NIST website [on this page](https://csrc.nist.gov/projects/cryptographic-algorithm-validation-program/block-ciphers). + +For example, with the following sample data set: ``` -tasklist | findstr /I "python" +KEY = 00000000000000000000000000000000 +PLAINTEXT = 6a84867cd77e12ad07ea1be895c53fa3 ``` +The program should output: +``` +CIPHERTEXT: 732281c0a0aab8f7a54a0c67a0c45ecf +``` + +To check this output, build the project and then execute this command: +``` +main.exe 6a84867cd77e12ad07ea1be895c53fa3 00000000000000000000000000000000 +``` + +You should now see the ciphertext `732281c0a0aab8f7a54a0c67a0c45ecf`. + Future work ----------- A few ideas to improve this project: -- Add mouse's position capture and send this data to the server. -- Automatically take a screenshot of the whole screen and send it to the server. -- Get some system information with `os.system('systeminfo')` and send them to the server. -- Automatically start the keylogger at computer start (thus not self-destroying it). +- Add decryption part. +- Test the implementation in ECB or CBC block cipher modes. +- Rewrite the key expansion function in a cleaner way. +- Add features for file encryption. License ------- This work is shared under the [MIT license](LICENSE). -Do not use this program without appropriate permissions. + +The AES S-Box initialization function has not been written by me and have been taken from: +https://en.wikipedia.org/wiki/Rijndael_S-box (Accessed on March 21, 2025) +Original licence: CC BY-SA 4.0