mojic 1.0.0 → 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.
- package/CONTRIBUTING.md +9 -10
- package/README.md +54 -57
- package/SECURITY.md +6 -2
- package/bin/mojic.js +1 -1
- package/package.json +1 -1
package/CONTRIBUTING.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
# Contributing to
|
|
1
|
+
# Contributing to Mojic
|
|
2
2
|
|
|
3
3
|
First off, thanks for taking the time to contribute! 🎉
|
|
4
4
|
|
|
5
|
-
The following is a set of guidelines for contributing to
|
|
5
|
+
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.
|
|
6
6
|
|
|
7
7
|
## How Can I Contribute?
|
|
8
8
|
|
|
9
9
|
### Reporting Bugs
|
|
10
10
|
|
|
11
|
-
This section guides you through submitting a bug report for
|
|
11
|
+
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.
|
|
12
12
|
|
|
13
13
|
* **Use a clear and descriptive title** for the issue to identify the problem.
|
|
14
14
|
* **Describe the exact steps which reproduce the problem** in as many details as possible.
|
|
@@ -16,11 +16,11 @@ This section guides you through submitting a bug report for Emojic. Following th
|
|
|
16
16
|
|
|
17
17
|
### Suggesting Enhancements
|
|
18
18
|
|
|
19
|
-
This section guides you through submitting an enhancement suggestion for
|
|
19
|
+
This section guides you through submitting an enhancement suggestion for Mojic, including completely new features and minor improvements to existing functionality.
|
|
20
20
|
|
|
21
21
|
* **Use a clear and descriptive title** for the issue to identify the suggestion.
|
|
22
22
|
* **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
|
|
23
|
-
* **Explain why this enhancement would be useful** to most
|
|
23
|
+
* **Explain why this enhancement would be useful** to most Mojic users.
|
|
24
24
|
|
|
25
25
|
## Styleguides
|
|
26
26
|
|
|
@@ -29,11 +29,10 @@ This section guides you through submitting an enhancement suggestion for Emojic,
|
|
|
29
29
|
* Use the present tense ("Add feature" not "Added feature")
|
|
30
30
|
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
|
|
31
31
|
* Limit the first line to 72 characters or less
|
|
32
|
-
* Reference issues and pull requests liberally after the first line
|
|
33
32
|
|
|
34
|
-
###
|
|
33
|
+
### Mojic Code Style
|
|
35
34
|
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* **Cipher Logic:** Changes to `CipherEngine.js` must ensure backward compatibility with the header format.
|
|
36
|
+
* **Streams:** Always use `StringDecoder` when handling text streams to prevent multi-byte emoji corruption.
|
|
38
37
|
|
|
39
|
-
Happy Hacking! 🚀
|
|
38
|
+
Happy Hacking! 🚀
|
package/README.md
CHANGED
|
@@ -1,70 +1,67 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Mojic 🔒🔮
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> **Obfuscate C source code into a randomized stream of emojis using password-seeded encryption.**
|
|
4
4
|
|
|
5
|
+
**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.
|
|
5
6
|
|
|
6
|
-
##
|
|
7
|
+
## 🚀 Features
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
* **🔐 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.
|
|
10
|
+
* **🌚 Moon Header Protocol:** The file header (Salt + Auth Hash) is encoded using only Moon and Clock emojis to allow metadata reading before decryption.
|
|
11
|
+
* **📂 Recursive Processing:** Encrypt or decrypt entire project directories with one flag.
|
|
12
|
+
* **🔄 Security Rotation:** Rotate passwords or re-scramble the entropy of encrypted files without seeing the plaintext.
|
|
13
|
+
* **⚡ Stream Based:** Handles large files efficiently using Node.js streams.
|
|
9
14
|
|
|
10
|
-
|
|
11
|
-
2. **Transform C to Emojic**: Turn your clean code into an unreadable emoji mess.
|
|
12
|
-
3. **Run in Cloud**: Execute your cursed code instantly via the `compiler.amit.is-a.dev` backend.
|
|
15
|
+
## 📦 Installation
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
```bash
|
|
18
|
+
npm install -g mojic
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 🛠️ Usage
|
|
22
|
+
|
|
23
|
+
### 1. Encrypting Code (`encode`)
|
|
24
|
+
Turns a `.c` file into a `.mojic` file.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Encrypt a single file
|
|
28
|
+
mojic encode main.c
|
|
29
|
+
|
|
30
|
+
# Encrypt an entire directory recursively
|
|
31
|
+
mojic encode ./src -r
|
|
32
|
+
```
|
|
33
|
+
*You will be prompted to create a password. This password is required to decrypt.*
|
|
34
|
+
|
|
35
|
+
### 2. Decrypting Code (`decode`)
|
|
36
|
+
Restores the original C code from a `.mojic` file.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# Decrypt a single file
|
|
40
|
+
mojic decode main.mojic
|
|
41
|
+
|
|
42
|
+
# Decrypt an entire directory recursively
|
|
43
|
+
mojic decode ./src -r
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 3. Security & Rotation Tools (`srt`)
|
|
47
|
+
Manage encrypted files without revealing their contents.
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Change the password of an encrypted file
|
|
51
|
+
mojic srt --pass secret.mojic
|
|
15
52
|
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- **Dark Mode IDE**: A VS Code-like experience in the browser.
|
|
20
|
-
|
|
21
|
-
## 🛠️ Installation & Deployment
|
|
22
|
-
|
|
23
|
-
This project is designed to be deployed on **Vercel** (Frontend + API).
|
|
24
|
-
|
|
25
|
-
1. **Clone the repo**
|
|
26
|
-
```bash
|
|
27
|
-
git clone [https://github.com/notamitgamer/](https://github.com/notamitgamer/)emojic.git
|
|
28
|
-
cd emojic
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
2. **Install Backend Dependencies**
|
|
32
|
-
```bash
|
|
33
|
-
pip install -r requirements.txt
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
3. **Run Locally**
|
|
37
|
-
```bash
|
|
38
|
-
python api/index.py
|
|
39
|
-
# Open index.html in your browser
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## 😒 Example Code
|
|
43
|
-
|
|
44
|
-
```c
|
|
45
|
-
/* The Hello World of Emojic */
|
|
46
|
-
#include<stdio.h>
|
|
47
|
-
|
|
48
|
-
#define 😒 int
|
|
49
|
-
#define 😊 main
|
|
50
|
-
#define 😂 (
|
|
51
|
-
#define 🤣 )
|
|
52
|
-
#define ❤️ printf
|
|
53
|
-
#define 😍 ;
|
|
54
|
-
#define 🙌 return
|
|
55
|
-
#define 👌 {
|
|
56
|
-
#define 😘 }
|
|
57
|
-
|
|
58
|
-
😒 😊😂🤣👌
|
|
59
|
-
❤️😂"Hello World!\n"🤣😍
|
|
60
|
-
🙌 0😍
|
|
61
|
-
😘
|
|
53
|
+
# Re-shuffle the encryption (New Salt) with the SAME password
|
|
54
|
+
# (Useful if you want to change the visual emoji pattern without changing the password)
|
|
55
|
+
mojic srt --re secret.mojic
|
|
62
56
|
```
|
|
63
57
|
|
|
64
|
-
##
|
|
58
|
+
## 🧠 How it Works
|
|
65
59
|
|
|
66
|
-
|
|
60
|
+
1. **Key Derivation:** Mojic uses **PBKDF2** to derive a 32-bit seed and an Auth Hash from your password and a random Salt.
|
|
61
|
+
2. **The Shuffle:** It uses a custom **Mulberry32 PRNG** seeded with your key to shuffle a "Universe" of ~1500 emojis.
|
|
62
|
+
3. **Tokenization:** C keywords (`int`, `return`, `void`) are tokenized and mapped to unique emojis from the shuffled universe. Remaining characters map to other emojis.
|
|
63
|
+
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.
|
|
67
64
|
|
|
68
65
|
## 📄 License
|
|
69
66
|
|
|
70
|
-
This project is licensed under the
|
|
67
|
+
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
|
package/SECURITY.md
CHANGED
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
## Reporting a Vulnerability
|
|
4
4
|
|
|
5
|
-
We take security seriously
|
|
5
|
+
We take security seriously.
|
|
6
6
|
|
|
7
|
-
If you discover a security vulnerability within
|
|
7
|
+
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.
|
|
8
8
|
|
|
9
9
|
**Please do not open public issues for security vulnerabilities.**
|
|
10
|
+
|
|
11
|
+
### Scope
|
|
12
|
+
* **Supported:** Issues regarding key derivation, salt collisions, or stream buffer overflows.
|
|
13
|
+
* **Not Supported:** Brute-forcing weak passwords (users are responsible for password strength).
|
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.
|
|
15
|
+
.version('1.0.2')
|
|
16
16
|
.addHelpCommand('help [command]', 'Display help for command')
|
|
17
17
|
.showHelpAfterError();
|
|
18
18
|
|