mojic 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/bin/mojic.js +1 -1
  2. package/package.json +1 -1
  3. package/files.py +0 -144
package/bin/mojic.js CHANGED
@@ -12,7 +12,7 @@ import { CipherEngine } from '../lib/CipherEngine.js';
12
12
  program
13
13
  .name('mojic')
14
14
  .description('Obfuscate C source code into emojis')
15
- .version('1.0.1')
15
+ .version('1.0.2')
16
16
  .addHelpCommand('help [command]', 'Display help for command')
17
17
  .showHelpAfterError();
18
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mojic",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Obfuscate C source code into emojis using password-seeded mapping",
5
5
  "main": "bin/mojic.js",
6
6
  "bin": {
package/files.py DELETED
@@ -1,144 +0,0 @@
1
- import os
2
-
3
- # --- Content Definitions ---
4
-
5
- CONTRIBUTING_MD = """# Contributing to Mojic
6
-
7
- First off, thanks for taking the time to contribute! 🎉
8
-
9
- The following is a set of guidelines for contributing to Mojic. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
10
-
11
- ## How Can I Contribute?
12
-
13
- ### Reporting Bugs
14
-
15
- This section guides you through submitting a bug report for Mojic. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports.
16
-
17
- * **Use a clear and descriptive title** for the issue to identify the problem.
18
- * **Describe the exact steps which reproduce the problem** in as many details as possible.
19
- * **Provide specific examples** to demonstrate the steps.
20
-
21
- ### Suggesting Enhancements
22
-
23
- This section guides you through submitting an enhancement suggestion for Mojic, including completely new features and minor improvements to existing functionality.
24
-
25
- * **Use a clear and descriptive title** for the issue to identify the suggestion.
26
- * **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
27
- * **Explain why this enhancement would be useful** to most Mojic users.
28
-
29
- ## Styleguides
30
-
31
- ### Git Commit Messages
32
-
33
- * Use the present tense ("Add feature" not "Added feature")
34
- * Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
35
- * Limit the first line to 72 characters or less
36
-
37
- ### Mojic Code Style
38
-
39
- * **Cipher Logic:** Changes to `CipherEngine.js` must ensure backward compatibility with the header format.
40
- * **Streams:** Always use `StringDecoder` when handling text streams to prevent multi-byte emoji corruption.
41
-
42
- Happy Hacking! 🚀
43
- """
44
-
45
- README_MD = """# Mojic 🔒🔮
46
-
47
- > **Obfuscate C source code into a randomized stream of emojis using password-seeded encryption.**
48
-
49
- **Mojic** (Magic + Emoji + Logic) is a CLI tool that transforms readable C code into an unreadable mess of emojis. Unlike simple substitution ciphers, Mojic uses your password to seed a Pseudo-Random Number Generator (PRNG), creating a unique "Emoji Universe" for every password.
50
-
51
- ## 🚀 Features
52
-
53
- * **🔐 Seeded Shuffling:** Your password derives a seed that shuffles the emoji mapping. Two different passwords will produce completely different emoji outputs for the same file.
54
- * **🌚 Moon Header Protocol:** The file header (Salt + Auth Hash) is encoded using only Moon and Clock emojis to allow metadata reading before decryption.
55
- * **📂 Recursive Processing:** Encrypt or decrypt entire project directories with one flag.
56
- * **🔄 Security Rotation:** Rotate passwords or re-scramble the entropy of encrypted files without seeing the plaintext.
57
- * **⚡ Stream Based:** Handles large files efficiently using Node.js streams.
58
-
59
- ## 📦 Installation
60
-
61
- ```bash
62
- npm install -g mojic
63
- ```
64
-
65
- ## 🛠️ Usage
66
-
67
- ### 1. Encrypting Code (`encode`)
68
- Turns a `.c` file into a `.mojic` file.
69
-
70
- ```bash
71
- # Encrypt a single file
72
- mojic encode main.c
73
-
74
- # Encrypt an entire directory recursively
75
- mojic encode ./src -r
76
- ```
77
- *You will be prompted to create a password. This password is required to decrypt.*
78
-
79
- ### 2. Decrypting Code (`decode`)
80
- Restores the original C code from a `.mojic` file.
81
-
82
- ```bash
83
- # Decrypt a single file
84
- mojic decode main.mojic
85
-
86
- # Decrypt an entire directory recursively
87
- mojic decode ./src -r
88
- ```
89
-
90
- ### 3. Security & Rotation Tools (`srt`)
91
- Manage encrypted files without revealing their contents.
92
-
93
- ```bash
94
- # Change the password of an encrypted file
95
- mojic srt --pass secret.mojic
96
-
97
- # Re-shuffle the encryption (New Salt) with the SAME password
98
- # (Useful if you want to change the visual emoji pattern without changing the password)
99
- mojic srt --re secret.mojic
100
- ```
101
-
102
- ## 🧠 How it Works
103
-
104
- 1. **Key Derivation:** Mojic uses **PBKDF2** to derive a 32-bit seed and an Auth Hash from your password and a random Salt.
105
- 2. **The Shuffle:** It uses a custom **Mulberry32 PRNG** seeded with your key to shuffle a "Universe" of ~1500 emojis.
106
- 3. **Tokenization:** C keywords (`int`, `return`, `void`) are tokenized and mapped to unique emojis from the shuffled universe. Remaining characters map to other emojis.
107
- 4. **The Header:** The Salt and Auth Hash are written to the top of the file using a fixed "Header Alphabet" (🌑🌒🌓🌔...) so the tool can verify your password before attempting decryption.
108
-
109
- ## 📄 License
110
-
111
- This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
112
- """
113
-
114
- SECURITY_MD = """# Security Policy
115
-
116
- ## Reporting a Vulnerability
117
-
118
- We take security seriously.
119
-
120
- If you discover a security vulnerability within Mojic (e.g., in the `CipherEngine` logic or the PRNG implementation), please send an e-mail to **amitdutta4255@gmail.com**. All security vulnerabilities will be promptly addressed.
121
-
122
- **Please do not open public issues for security vulnerabilities.**
123
-
124
- ### Scope
125
- * **Supported:** Issues regarding key derivation, salt collisions, or stream buffer overflows.
126
- * **Not Supported:** Brute-forcing weak passwords (users are responsible for password strength).
127
- """
128
-
129
- # --- File Generation ---
130
-
131
- def write_file(filename, content):
132
- try:
133
- with open(filename, 'w', encoding='utf-8') as f:
134
- f.write(content)
135
- print(f"✅ Successfully generated {filename}")
136
- except Exception as e:
137
- print(f"❌ Error generating {filename}: {e}")
138
-
139
- if __name__ == "__main__":
140
- print("🚀 Generating Mojic Documentation...")
141
- write_file("CONTRIBUTING.md", CONTRIBUTING_MD)
142
- write_file("README.md", README_MD)
143
- write_file("SECURITY.md", SECURITY_MD)
144
- print("✨ Done.")