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 run a C++ program

npmnpm
Version
1.0.0
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
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> ```

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

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

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