aes256-async
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

AES-256 Async

The aes256-async package allows developers to easily encrypt and decrypt data by making use of the AES-256 specification. It exposes syncrhonous and asynchronous functions to avoid blocking the main thread. Moreover, the secret can be of any size because it is hashed using the Secure Hash Algorithm 2 (SHA-256).

Getting Started

Install the package:

npm install -S aes256-async

Usage

Encrypt and decrypt data asynchronously:

import { encrypt, decrypt } from 'aes256-async';

const secret = 'My.$ecreT';

await encrypt(secret, 'Hello world!')
// OrGfQ/91d7p/1BN6Q07Jly5ZK0/7pyczjk5vgw==

await decrypt(secret, 'OrGfQ/91d7p/1BN6Q07Jly5ZK0/7pyczjk5vgw==')
// 'Hello world!'

Encrypt and decrypt data synchronously (blocking the main thread):

import { encryptSync, decryptSync } from 'aes256-async';

const secret = 'My.$ecreT';

encryptSync(secret, 'Hello world!')
// OrGfQ/91d7p/1BN6Q07Jly5ZK0/7pyczjk5vgw==

decryptSync(secret, 'OrGfQ/91d7p/1BN6Q07Jly5ZK0/7pyczjk5vgw==')
// 'Hello world!'

Built With

  • TypeScript

Acknowledgements


Running the Tests

# integration tests
npm run test:integration

# unit tests
npm run test:unit

License

MIT


Deployment

Install dependencies:

npm install

Build the library:

npm start

Publish to npm:

npm publish

Package Sidebar

Install

npm i aes256-async

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

14.2 kB

Total Files

13

Last publish

Collaborators

  • jesusgraterol