@sjc5/crypto
v2.0.0
Published
High-level crypto utils.
Downloads
2
Readme
@sjc5/crypto
Simple, high-level crypto utils in TypeScript.
Has two dependencies:
tweetnacl
for the underlying crypto and @stablelib/base64
for base64 encoding utils.
Installation:
npm i @sjc5/crypto
Usage:
import { random_key, encrypt, decrypt } from "@sjc5/crypto"
const message = "hello world"
const key = random_key()
const encrypted_message = encrypt({ message, key })
const decrypted = decrypt({ encrypted_message, key })