docs

Log | Files | Refs | Activity

root / src / mojic / usage.md

usage.md (1078B)


      1 ---
      2 label: CLI Usage
      3 order: 730
      4 ---
      5 
      6 # CLI Usage
      7 
      8 ## 1. Encrypting code (`encode`)
      9 
     10 Transforms a `.c` file into a `.mojic` file. You'll be prompted to create a password — it's required to decrypt.
     11 
     12 ```bash
     13 # Encrypt a single file
     14 mojic encode main.c
     15 
     16 # Encrypt an entire directory recursively
     17 mojic encode ./src -r
     18 
     19 # Flatten/minify code structure before encryption (removes newlines/indentation)
     20 mojic encode main.c --flat
     21 ```
     22 
     23 ## 2. Decrypting code (`decode`)
     24 
     25 Restores the original C code from a `.mojic` file.
     26 
     27 ```bash
     28 # Decrypt a single file
     29 mojic decode main.mojic
     30 
     31 # Decrypt an entire directory recursively
     32 mojic decode ./src -r
     33 ```
     34 
     35 ## 3. Security & rotation tools (`srt`)
     36 
     37 Manage encrypted files without ever revealing their plaintext contents.
     38 
     39 ```bash
     40 # Rotate password: changes the password of an encrypted file
     41 mojic srt --pass secret.mojic
     42 
     43 # Re-encrypt: re-shuffles the entropy (new salt) with the SAME password
     44 # useful to change the visual emoji pattern without changing the password
     45 mojic srt --re secret.mojic
     46 ```
     47 
     48 Continue to [How It Works](algorithm.md).
© 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