docs

Log | Files | Refs | Activity

root / src / mojic / algorithm.md

algorithm.md (1741B)


      1 ---
      2 label: How It Works
      3 icon: beaker
      4 order: 720
      5 ---
      6 
      7 # Under the Hood: Operation Ironclad
      8 
      9 Mojic v2.1.0 implements a custom crypto-system dubbed "Operation Ironclad."
     10 
     11 ## 1. Derivation phase
     12 
     13 - **Input:** user password + 32-byte random salt
     14 - **KDF:** `Scrypt` (N=16384, r=8, p=1)
     15 - **Output:** 80 bytes — 32 bytes AES key, 16 bytes AES IV, 32 bytes HMAC auth key
     16 
     17 ## 2. The Emoji Universe
     18 
     19 The engine generates a universe of roughly 1,100 valid unicode characters (emoticons, transport, symbols), then **shuffles** it using the AES-256-CTR CSPRNG initialized with the derived key.
     20 
     21 ## 3. Polymorphic encryption
     22 
     23 - **C keywords:** the engine detects C keywords (e.g. `while`) and assigns each one a "base emoji" from the shuffled universe.
     24 - **The twist:** it doesn't just print the base emoji — it calculates a random offset using the PRNG to pick a *different* emoji that still maps back to the keyword. That means `int` might render as 🚀 on line 1 and 🌮 on line 5, making frequency analysis useless.
     25 
     26 ## 4. XOR whitening
     27 
     28 Before encoding non-keyword data (variable names, strings, whitespace), the engine generates a random mask from the AES stream and XORs the raw data with it. This turns repetitive patterns — like indentation or common variable names — into white noise before they're converted to emojis.
     29 
     30 ## 5. Base-1024 encoding
     31 
     32 The whitened data is buffered into 5-byte chunks, treated as a single large integer, and converted into 4 base-1024 digits, each mapped to an emoji.
     33 
     34 ## 6. The header
     35 
     36 The salt and a 4-byte auth check are written to the file header using the Moon/Clock alphabet (`🌑🌒🌓🌔...`). This lets Mojic report "Incorrect Password" instantly, rather than churning out garbage data first.
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror