AES GCM Password Codec
An Isomorphic PBKDF2 + AES-GCM password codec implementation for NodeJS and the Browser.
Browser:
<script src='https://unpkg.com/aesgcm_password_codec/umd/aesgcm_password_codec.min.js'></script>
NodeJS:
$ npm i aesgcm_password_codec
Quick Start
const aesgcm_password_codec = require('aesgcm_password_codec')
async function demo() {
const aes_codec = await aesgcm_password_codec(
'secret password', { salt: '+t07slf9nBY9Z5PPynvF2g==' })
console.log(aes_codec.options)
const obj = {hello: 'friendly npm or github user!'}
const enc_rec_b64 = await aes_codec.encrypt_json(obj)
console.log(enc_rec_b64)
const rt_obj = await aes_codec.decrypt_json(enc_rec_b64)
console.log(rt_obj)
const rt_stored = await aes_codec.decrypt_json(
"tODalsnEZXa5ai9D aPa9IQUSdWhrAiL18a0j/rgPuK084ebdnwOo/uzckc3qfIr4qxoaAYIQNVwcAty+GCgI4L2jnQ==")
console.log(rt_stored)
}
Related
Project built with JSY-lang.
License
MIT