https://github.com/sjc5/crypto
Assorted high-level cryptography utils in TypeScript
https://github.com/sjc5/crypto
crypto decryption encryption high-level typescript
Last synced: about 1 year ago
JSON representation
Assorted high-level cryptography utils in TypeScript
- Host: GitHub
- URL: https://github.com/sjc5/crypto
- Owner: sjc5
- Created: 2023-04-02T20:23:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-03T01:35:20.000Z (about 3 years ago)
- Last Synced: 2024-10-12T23:44:36.397Z (over 1 year ago)
- Topics: crypto, decryption, encryption, high-level, typescript
- Language: TypeScript
- Homepage:
- Size: 43.9 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
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:
```sh
npm i @sjc5/crypto
```
## Usage:
```ts
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 })
```