Reverse Binary Logic
This CMake workspace contains a collection of C++ projects focused on custom logic compilation, cryptographic puzzles, and encryption utilities.
Projects
1. Reverse Binary Logic (`reverse binary logic`)
The core component of the solution. It implements a custom language infrastructure including:
- **Tokenizer & AST Generator**: A hand-written lexer and parser for a custom expression language (`frbitlogic.cpp`).
- **Bit Logic**: Headers and classes for handling bit-level logic operations (`BitLogic.h`, `BinaryLogic.h`).
- **Branchless Compiler**: A component for compiling logic into branchless code (`BranchlessCompiler.h`).
2. 3301 (`3301`)
A workspace dedicated to solving cryptographic challenges, specifically referencing the Cicada 3301 puzzles.
- Implements SHA-512 hashing and a bounded preimage search CLI.
- Supports hashing text, dictionary search, and charset brute force with optional prefixes/suffixes.
- Note: SHA-512 cannot be reversed directly; the tool searches candidate inputs.
3. Theo AES UUID (`theo_aes_uuid`)
A utility for AES-256-CBC encryption using UUIDs as passwords.
- **Functionality**: Encrypts data using OpenSSL's EVP interface, deriving keys from a UUID string.
- **Compatibility**: Designed to match the output of `openssl enc -aes-256-cbc -salt -pass pass:<UUID>`.
Build Instructions
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/Synchronised/vcpkg/scripts/buildsystems/vcpkg.cmake
cmake --build build --config Debug --parallel
ctest --test-dir build -C Debug --output-on-failure
If you do not want to build the OpenSSL-dependent AES utility, add `-DBUILD_THEO_AES_UUID=OFF` to the configure command.
SHA-512 Reverser Usage
.\build\Debug\3301.exe --self-test
.\build\Debug\3301.exe --hash abc
.\build\Debug\3301.exe --reverse <128-hex-sha512> --dict words.txt
.\build\Debug\3301.exe --reverse <128-hex-sha512> --charset abc123 --min 1 --max 6 --max-attempts 1000000
Whitespace-split hash chunks are accepted after `--reverse`, so a long digest can be pasted in groups.
Dependencies
- **OpenSSL**: Required for `theo_aes_uuid`. The CMake build supports vcpkg via `CMAKE_TOOLCHAIN_FILE`.