Modules@robinpath/encrypt

@robinpath/encrypt

0.1.0Public

AES and RSA encryption/decryption with key generation

@robinpath/encrypt

AES-256-GCM and RSA encryption/decryption with key generation, password-based key derivation, and hashing

Category Functions Auth License

Why use this module?

The encrypt module lets you:

  • Encrypt text with AES using a password (auto-generates salt/IV)
  • Decrypt AES-encrypted data using a password
  • Encrypt text with a raw hex key (for advanced use)
  • Generate a cryptographically secure random key
  • Generate an RSA key pair

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

npm install @robinpath/encrypt

Quick Start

No credentials needed — start using it right away:

encrypt.aesDecrypt $encryptedData "my-password"

Available Functions

FunctionDescription
encrypt.aesEncryptEncrypt text with AES using a password (auto-generates salt/IV)
encrypt.aesDecryptDecrypt AES-encrypted data using a password
encrypt.aesEncryptRawEncrypt text with a raw hex key (for advanced use)
encrypt.generateKeyGenerate a cryptographically secure random key
encrypt.rsaGenerateKeysGenerate an RSA key pair
encrypt.rsaEncryptEncrypt text with an RSA public key
encrypt.rsaDecryptDecrypt RSA-encrypted text with a private key
encrypt.hashHash a string (sha256, sha512, md5, etc.)
encrypt.deriveKeyDerive an encryption key from a password using scrypt
encrypt.randomIvGenerate a random initialization vector

Examples

Decrypt AES-encrypted data using a password

encrypt.aesDecrypt $encryptedData "my-password"

Encrypt text with a raw hex key (for advanced use)

encrypt.aesEncryptRaw "data" $hexKey

Generate a cryptographically secure random key

encrypt.generateKey 256

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/encrypt";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  encrypt.aesDecrypt $encryptedData "my-password"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

Related Modules

License

MIT

Versions (1)

VersionTagPublished
0.1.0latestyesterday
Install
$ robinpath install @robinpath/encrypt
Version0.1.0
LicenseMIT
Unpacked Size4.7 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

Category

utilities