mojic

Obfuscate C source code into e...
Log | Files | Refs | README | LICENSE

commit 5de6daa9930047962c53d81adcc4824c63ae0660
parent f0956c387d5813e1678a0853e130c4eefc3639cc
Author: Amit Dutta <amitdutta4255@gmail.com>
Date:   Fri, 30 Jan 2026 12:50:35 +0530

ok
Merge branch 'main' of https://github.com/notamitgamer/mojic

Diffstat:
MREADME.md | 41+++++++++++++++++++++++------------------
1 file changed, 23 insertions(+), 18 deletions(-)

diff --git a/README.md b/README.md @@ -1,17 +1,18 @@ -# Mojic v1.2.5 +# Mojic v2.1.0 -> **Operation Polymorphic Chaos: Obfuscate C source code into a randomized, password-seeded stream of emojis.** +> **Operation Ironclad: Obfuscate C source code into a randomized, password-seeded stream of emojis.** **Mojic** (Magic + Emoji + Logic) is a sophisticated CLI tool designed to transform readable C code into an unrecognizable chaotic stream of emojis. Unlike simple substitution ciphers, Mojic uses your password to seed a cryptographically strong Pseudo-Random Number Generator (PRNG), creating a unique "Emoji Universe" and rolling cipher for every single session. ## Key Features -* ** Xoshiro256** PRNG:** Uses a high-quality 256-bit state PRNG (seeded via PBKDF2-SHA512) to handle shuffling and polymorphism. -* ** Polymorphic Keywords:** Common C keywords (`int`, `void`, `return`) are mapped to emojis that *change* every time they appear based on the PRNG state. Frequency analysis is impossible. -* ** Base-1024 Compression:** Non-keyword code is compressed using a custom Base-1024 scheme (5 bytes โ†’ 4 emojis), keeping file size manageable. -* ** Integrity Sealed:** Every file ends with an HMAC-SHA256 signature. Any tampering with the emoji stream results in an immediate `FILE_TAMPERED` error. -* ** Moon Header Protocol:** Metadata (Salt + Auth Check) is encoded using a specific alphabet of Moon and Clock phases (`๐ŸŒ‘๐ŸŒ’๐Ÿ•`), allowing instant password verification before decryption starts. -* ** Stream Architecture:** Built on Node.js `Transform` streams to handle large files efficiently with minimal memory footprint. +* **AES-256-CTR PRNG:** Uses a military-grade cryptographically secure pseudorandom number generator (seeded via Scrypt) to handle shuffling and polymorphism. +* **Polymorphic Keywords:** Common C keywords (`int`, `void`, `return`) are mapped to emojis that *change* every time they appear based on the PRNG state. Frequency analysis is impossible. +* **XOR Whitening:** Before encoding, all raw data (whitespace, variable names) is XORed with the AES keystream. This ensures that repeating patternsโ€”like 4 spaces of indentationโ€”never produce the same emoji sequence twice. +* **Base-1024 Compression:** Non-keyword code is compressed using a custom Base-1024 scheme (5 bytes โ†’ 4 emojis), keeping file size manageable. +* **Integrity Sealed:** Every file ends with an HMAC-SHA256 signature. Any tampering with the emoji stream results in an immediate `FILE_TAMPERED` error. +* **Moon Header Protocol:** Metadata (Salt + Auth Check) is encoded using a specific alphabet of Moon and Clock phases (`๐ŸŒ‘๐ŸŒ’๐Ÿ•`), allowing instant password verification before decryption starts. +* **Stream Architecture:** Built on Node.js `Transform` streams to handle large files efficiently with minimal memory footprint. ## Installation @@ -69,26 +70,30 @@ mojic srt --re secret.mojic ## Under the Hood (Algorithm) -Mojic v1.1.0 implements a custom crypto-system dubbed **"Operation Polymorphic Chaos"**. +Mojic v2.1.0 implements a custom crypto-system dubbed **"Operation Ironclad"**. 1. **Derivation Phase:** - * **Input:** User Password + 16-byte Random Salt. - * **KDF:** `PBKDF2-SHA512` (100,000 iterations). - * **Output:** 64 bytes (32 bytes for PRNG Seed, 32 bytes for HMAC Auth Key). + * **Input:** User Password + 32-byte Random Salt. + * **KDF:** `Scrypt` (N=16384, r=8, p=1). + * **Output:** 80 bytes (32 bytes AES Key, 16 bytes AES IV, 32 bytes HMAC Auth Key). 2. **The Emoji Universe:** - * The engine generates a universe of ~1,100 valid emojis (Emoticons, Transport, Symbols). - * This universe is **shuffled** using the `Xoshiro256**` PRNG initialized with the derived seed. + * The engine generates a universe of ~1,100 valid unicode characters (Emoticons, Transport, Symbols). + * This universe is **shuffled** using the `AES-256-CTR` CSPRNG initialized with the derived key. 3. **Polymorphic Encryption:** * **C Keywords:** The engine detects C keywords (e.g., `while`). It assigns them a "Base Emoji" from the shuffled universe. * **The Twist:** It doesn't just print the Base Emoji. It calculates a random offset using the PRNG to pick a *different* emoji that maps back to the keyword. This means `int` might look like `๐Ÿš€` on line 1 and `๐ŸŒฎ` on line 5. -4. **Base-1024 Encoding:** - * Non-keyword data is buffered into 5-byte chunks. - * These chunks are treated as a single large integer and converted into 4 base-1024 digits (mapped to emojis), effectively compressing the stream density. +4. **XOR Whitening:** + * Before encoding non-keyword data (variable names, strings, whitespace), the engine generates a random mask from the AES stream. + * The raw data is **XORed** with this mask. This hides repetitive patterns (like indentation or common variable names) effectively turning them into white noise before they are converted to emojis. -5. **The Header:** +5. **Base-1024 Encoding:** + * The whitened data is buffered into 5-byte chunks. + * These chunks are treated as a single large integer and converted into 4 base-1024 digits (mapped to emojis). + +6. **The Header:** * The Salt and a 4-byte Auth Check are written to the file header using the **Moon/Clock Alphabet** (`๐ŸŒ‘๐ŸŒ’๐ŸŒ“๐ŸŒ”...`). * **Benefit:** This allows `mojic` to tell you "Incorrect Password" instantly, rather than churning out garbage data first.
ยฉ notamitgamer โ€ข Site Built: 2026-07-21 13:58:23 UTC โ€ข git-mirror commit: 1037f62 [view raw info]
Originally created with stagit โ€ข modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror