npm.io
1.0.4 • Published 4 years ago

@theobaidur/simple-encrypt-decrypt

Licence
ISC
Version
1.0.4
Deps
0
Size
10 kB
Vulns
0
Weekly
0

Simple Encrypt Decrypt

The simplest library to encrypt & decrypt text. This is suitable for small & simple applications.

You should never use this library for serious projects.

Usage

import config, { decrypt, encrypt } from "@theobaidur/simple-encrypt-decrypt";

// configuration

config.salt = "simple_encrypt_decrypt";

// encrypt some text

const encrypted = encrypt("Hello world");

console.log(encrypted); // output:: 4c6168686b24736b766860

// decrypt the encrypted text

const text = decrypt(encrypted);

console.log(text); // output:: Hello world

Credits

Inspired from