@distributedvc/aes
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@distributedvc/aes

Code Style npm version License MIT
dependencies Circle CI npm downloads Package Phobia Bundle Phobia

Package to encrypt & decrypt strings using aes-256-gcm.

Install

With yarn:

yarn add @distributedvc/aes

With npm:

npm install @distributedvc/aes

Usage

Don't use this package to encrypt your passwords, use hashing algorithms like argon2 or bcrypt instead.

import { encrypt, decrypt } from '@distributedvc/aes';

const key = 'secureKey';

const encrypted = encrypt(key, 'foo'); // 4lxXNMY0dxjTLtP2i8KV3Fe770+yaEj3KnGUPdKKHn0pgXo=
const decrypted = decrypt(key, encrypted); // foo

Demo on the fly

# Encrypt
curl https://distributed-aes.vercel.app/encrypt?key=secureKey&input=foo
# -> aWmlhjZpAn/vbhsN60zciuUMnNNyec8ow0mNNde/IbCgy0M=%

# Decrypt
curl -X https://distributed-aes.vercel.app/decrypt?key=secureKey&input="aWmlhjZpAn/vbhsN60zciuUMnNNyec8ow0mNNde/IbCgy0M="
# -> foo

Development

  1. Install dependencies using yarn install or npm install
  2. Start development server using yarn watch

/@distributedvc/aes/

    Package Sidebar

    Install

    npm i @distributedvc/aes

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    14.2 kB

    Total Files

    11

    Last publish

    Collaborators

    • gomah