docs

git clone https://github.com/notamitgamer/docs.git
ยท rebuilt hourlyOpen on GitHub
root / mojic / algorithm.mdx

algorithm.mdx (1797B)


      1 ---
      2 title: "Under the Hood: Operation Ironclad"
      3 sidebarTitle: "How It Works"
      4 ---
      5 
      6 import Copyright from "/snippets/copyright.mdx";
      7 
      8 Mojic v2.1.0 implements a custom crypto-system dubbed "Operation Ironclad."
      9 
     10 ## 1. Derivation phase
     11 
     12 - **Input:** user password + 32-byte random salt
     13 - **KDF:** `Scrypt` (N=16384, r=8, p=1)
     14 - **Output:** 80 bytes โ€” 32 bytes AES key, 16 bytes AES IV, 32 bytes HMAC auth key
     15 
     16 ## 2. The Emoji Universe
     17 
     18 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.
     19 
     20 ## 3. Polymorphic encryption
     21 
     22 - **C keywords:** the engine detects C keywords (e.g. `while`) and assigns each one a "base emoji" from the shuffled universe.
     23 - **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.
     24 
     25 ## 4. XOR whitening
     26 
     27 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.
     28 
     29 ## 5. Base-1024 encoding
     30 
     31 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.
     32 
     33 ## 6. The header
     34 
     35 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.
     36 
     37 <Copyright />