{"id":42827698,"url":"https://github.com/notamitgamer/mojic","last_synced_at":"2026-02-03T15:00:55.795Z","repository":{"id":334927033,"uuid":"1143422074","full_name":"notamitgamer/mojic","owner":"notamitgamer","description":"Obfuscate C source code into encrypted, password-seeded emoji streams.","archived":false,"fork":false,"pushed_at":"2026-01-30T07:40:19.000Z","size":3702,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-31T00:42:48.152Z","etag":null,"topics":["c","code","decryption","emoji","encryption","mojic","npm","npm-package"],"latest_commit_sha":null,"homepage":"https://amit.is-a.dev/mojicDocs","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/notamitgamer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-27T15:05:30.000Z","updated_at":"2026-01-30T10:05:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/notamitgamer/mojic","commit_stats":null,"previous_names":["notamitgamer/emojic","notamitgamer/mojic"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/notamitgamer/mojic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notamitgamer%2Fmojic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notamitgamer%2Fmojic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notamitgamer%2Fmojic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notamitgamer%2Fmojic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/notamitgamer","download_url":"https://codeload.github.com/notamitgamer/mojic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/notamitgamer%2Fmojic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28939485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T10:18:23.202Z","status":"ssl_error","status_checked_at":"2026-01-31T10:18:22.693Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","code","decryption","emoji","encryption","mojic","npm","npm-package"],"created_at":"2026-01-30T10:54:31.524Z","updated_at":"2026-01-31T11:00:25.354Z","avatar_url":"https://github.com/notamitgamer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mojic v2.1.2\n\n\u003e **Operation Ironclad: Obfuscate C source code into a randomized, password-seeded stream of emojis.**\n\n**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.\n\n## Key Features\n\n* **AES-256-CTR PRNG:** Uses a military-grade cryptographically secure pseudorandom number generator (seeded via Scrypt) to handle shuffling and polymorphism.\n* **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.\n* **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.\n* **Base-1024 Compression:** Non-keyword code is compressed using a custom Base-1024 scheme (5 bytes → 4 emojis), keeping file size manageable.\n* **Integrity Sealed:** Every file ends with an HMAC-SHA256 signature. Any tampering with the emoji stream results in an immediate `FILE_TAMPERED` error.\n* **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.\n* **Stream Architecture:** Built on Node.js `Transform` streams to handle large files efficiently with minimal memory footprint.\n\n## Installation\n\nSince Mojic is available on npm, you can install it globally with a single command:\n\n```bash\nnpm install -g mojic\n```\n\nOr run it directly using `npx` without installing:\n\n```bash\nnpx mojic encode main.c\n```\n\n## Usage\n\n### 1. Encrypting Code (`encode`)\nTransforms a `.c` file into a `.mojic` file.\n\n```bash\n# Encrypt a single file\nmojic encode main.c\n\n# Encrypt an entire directory recursively\nmojic encode ./src -r\n\n# Flatten/Minify code structure before encryption (Removes newlines/indentation)\nmojic encode main.c --flat\n```\n*You will be prompted to create a password. This password is required to decrypt.*\n\n### 2. Decrypting Code (`decode`)\nRestores the original C code from a `.mojic` file.\n\n```bash\n# Decrypt a single file\nmojic decode main.mojic\n\n# Decrypt an entire directory recursively\nmojic decode ./src -r\n```\n\n### 3. Security \u0026 Rotation Tools (`srt`)\nManage encrypted files without ever revealing their plaintext contents.\n\n```bash\n# Rotate Password: Changes the password of an encrypted file\nmojic srt --pass secret.mojic\n\n# Re-Encrypt: Re-shuffles the entropy (New Salt) with the SAME password\n# (Useful to change the visual emoji pattern without changing the password)\nmojic srt --re secret.mojic\n```\n\n## Under the Hood (Algorithm)\n\nMojic v2.1.0 implements a custom crypto-system dubbed **\"Operation Ironclad\"**.\n\n1.  **Derivation Phase:**\n    * **Input:** User Password + 32-byte Random Salt.\n    * **KDF:** `Scrypt` (N=16384, r=8, p=1).\n    * **Output:** 80 bytes (32 bytes AES Key, 16 bytes AES IV, 32 bytes HMAC Auth Key).\n\n2.  **The Emoji Universe:**\n    * The engine generates a universe of ~1,100 valid unicode characters (Emoticons, Transport, Symbols).\n    * This universe is **shuffled** using the `AES-256-CTR` CSPRNG initialized with the derived key.\n\n3.  **Polymorphic Encryption:**\n    * **C Keywords:** The engine detects C keywords (e.g., `while`). It assigns them a \"Base Emoji\" from the shuffled universe.\n    * **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.\n\n4.  **XOR Whitening:**\n    * Before encoding non-keyword data (variable names, strings, whitespace), the engine generates a random mask from the AES stream.\n    * 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.\n\n5.  **Base-1024 Encoding:**\n    * The whitened data is buffered into 5-byte chunks.\n    * These chunks are treated as a single large integer and converted into 4 base-1024 digits (mapped to emojis).\n\n6.  **The Header:**\n    * The Salt and a 4-byte Auth Check are written to the file header using the **Moon/Clock Alphabet** (`🌑🌒🌓🌔...`).\n    * **Benefit:** This allows `mojic` to tell you \"Incorrect Password\" instantly, rather than churning out garbage data first.\n\n## License\n\nThis project is licensed under the Apache License 2.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotamitgamer%2Fmojic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnotamitgamer%2Fmojic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnotamitgamer%2Fmojic/lists"}