nodes-crypter
v1.0.6
Published
A package to encrypt a C++ program to create a script that can decrypt & run as a child process (usage: nodes-crypter ./original keyphrase && node run.js).
Downloads
4
Readme
nodes-crypter
A Node.js package to encrypt and run a C++ program using XOR encryption.
Features
- Encrypt any C++ executable file.
- Decrypt and run the encrypted executable file.
Installation
Install the package globally or locally using npm:
npm install -g nodes-crypter
or
npm install nodes-crypter
Usage
Encrypting and Running a C++ Program
To encrypt a C++ executable file and generate a self-contained run.js
script, use the following command:
If you installed globally (-g flag) you do not need to use 'npx' in front.
npx nodes-crypter <input_file> <key>
or if you installed globally (-g flag) you do not need to use 'npx' in front.
nodes-crypter <input_file> <key>
Example:
nodes-crypter ./hello mysecretkey
This command encrypts the hello
executable and outputs a run.js
file containing the encrypted data and the logic to decrypt and execute it using the key mysecretkey
.
Running the Generated Script
To decrypt and run the executable, use the following command:
node run.js
Creating a Test C++ Program
To create a simple "Hello, World!" C++ program, follow these steps:
Create a C++ source file
hello.cpp
:#include <iostream> int main() { std::cout << "Hello, World!" << std::endl; return 0; }
Compile the C++ program:
g++ hello.cpp -o hello
Encrypt the executable and generate the
run.js
file:nodes-crypter ./hello mysecretkey
Run the generated script to decrypt and execute the program:
node run.js
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
LNodesL