forentfraps/BES
BogusEncryptionStandard
BogusEncryptionStandard (BES) is an ironic encryption algorithm designed for educational and entertainment purposes. It leverages the aesenc
x86 opcode as a pseudo-random number generator (PRNG) to encrypt data in a highly inefficient and impractical manner. Please note that BES is not intended for real-world cryptographic use and should not be used to secure sensitive information.
BES encrypts data by iteratively generating outputs with the help of aesenc
instruction until the first byte of the output matches the byte to be encrypted. The ciphertext consists of the number of iterations it took to find each matching byte. The decryption process reverses this by regenerating the PRNG outputs using the same seed and counts.
aesenc
with the current seed.Note: if the required byte is not found after 65535 iterations, everything goes up in flames, since it is obviously the user's fault for picking a faulty key. However the probabiliy of that is like 10^-112
BES can be built on both Linux and Windows systems.
Clone the Repository:
git clone https://github.com/forentfraps/BES.git
cd BES
Build it
zig build
-e Encrypt mode
-d Decrypt mode
-k [hex_string] 16-byte key in hex (default: 0xDEADBEEFCAFEBABEEF)
-i [filepath] Input file path
-o [filepath] Output file path (default: output.enc)
-h Display help menu
./bes -e -i plaintext.txt -o ciphertext.enc -k DEADBEEFCAFEBABEEF
./bes -d -i ciphertext.enc -o decrypted.txt -k DEADBEEFCAFEBABEEF
./bes -h
The project includes a test suite to verify the correctness of the encryption and decryption functions.
zig build test
This project is licensed under the MIT License. See the LICENSE file for details.