@altcha/crypto
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

ALTCHA JS Crypto Library

A lightweight library simplifying asymmetric data encryption using Web Crypto. It employs a hybrid approach combining RSA keys and AES encryption for enhanced security.

Features

  • Simplified hybrid encryption using RSA + AES
  • Compatible with all modern browsers supporting Web Crypto
  • Supports node.js streams, facilitating encryption of large files

Compatibility

  • Node.js 20+
  • Bun 1+
  • Deno 1+
  • Modern browsers

Usage

import { cipher, rsa } from '@altcha/crypto';

const keyPair = await rsa.generateKeyPair();

const encrypted = await cipher.encrypt(keyPair.publicKey, new TextEncoder().encode('Hello World'));

const decrypted = await cipher.decrypt(keyPair.privateKey, encrypted);

Node.js streams:

import { createReadStream, createWriteStream } from 'node:fs';
import { nodeCipher, rsa } from '@altcha/crypto';

const keyPair = await rsa.generateKeyPair();

await nodeCipher.encryptStream(keyPair.publicKey, createReadStream('./input.txt'), createWriteStream('./output.txt.enc'));

API

TODO

License

MIT

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.13,297latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.13,297

Package Sidebar

Install

npm i @altcha/crypto

Weekly Downloads

650

Version

0.0.1

License

MIT

Unpacked Size

38.5 kB

Total Files

36

Last publish

Collaborators

  • ovx