New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

cpp-crypter

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cpp-crypter

A package to encrypt and decrypt & run a C++ program

latest
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

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-crypter

or

npm install cpp-crypter

Usage

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 mysecretkey

This 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 mysecretkey

This 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 hello
    
  • Encrypt the executable:

    npx cpp-crypter encrypt ./hello ./hello.enc mysecretkey
    
  • Decrypt 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

FAQs

Package last updated on 27 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts