cpp-crypter
v1.0.4
Published
A package to encrypt and decrypt & run a C++ program
Downloads
5
Readme
cpp-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.
- Handles large files efficiently using buffers.
Installation
Install the package globally or locally using npm:
npm install -g cpp-crypteror
npm install cpp-crypterUsage
Encrypting a C++ Program
To encrypt a C++ executable file, use the encrypt command:
npx cpp-crypter encrypt <input_file> <output_file> <key>Example:
npx cpp-crypter encrypt ./hello ./hello.enc mysecretkeyThis command encrypts the hello executable and outputs the encrypted file as hello.enc using the key mysecretkey.
Decrypting and Running the Program
To decrypt and run the encrypted executable file, use the main script index.js:
node index.js <encrypted_file> <key>Example:
node index.js ./hello.enc mysecretkeyThis command decrypts the hello.enc file using the key mysecretkey and runs the decrypted executable.
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 helloEncrypt the executable:
npx cpp-crypter encrypt ./hello ./hello.enc mysecretkeyDecrypt and run the executable:
node index.js ./hello.enc mysecretkey
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
LNodesL
