1.0.19 • Published 3 years ago

@ronak.iihglobal/stringcrypto v1.0.19

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

About StringCrypto

This is simple package for encrypt/decrypt small strings like database IDs with ease. It is based on inbuilt node module crypto.

The encrypt method used is AES-256-CBC.

Usage

npm i @ronak.iihglobal/stringcrypto

then

const { encrypt, decrypt } = require('@ronak.iihglobal/stringcrypto')("str_of_len_32","str_of_len_16");

Note args and constraints on key and IV length. Also keep both strings secret in .env.

OR

Just copy index.js file from github and put it in you project as it is simple one file module.

Once module imported and called with proper arguments, we can simply use it like below,

let encrypted = encrypt("mystring")

let decrypted = decrypt(encrypted)

In framework like expressJs we can simply declare it in app.js/index.js once global like below

global._encrypt = encrypt;

and reuse it in whole app like below

let encrypted = _encrypt("mystring")

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago