Skip to content
/ crypto Public

Assorted high-level cryptography utils in TypeScript

Notifications You must be signed in to change notification settings

sjc5/crypto

Repository files navigation

@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 })