0.1.2 • Published 5 years ago

@arispati/crypto-aes v0.1.2

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

CryptoAESJS

AES crypto library which can be used in php and javascript (Javascript Version).

If you want to use this library in PHP use the CryptoAES.

How to Install

  • Install with npm
npm install @arispati/crypto-aes

How to Use

import CryptoAES from '@arispati/crypto-aes'

// Set the secret key
let secretKey = 's3cr3tK3y' // default secret key

// Initilize CryptoAES Class
let crypto = new CryptoAES(secretKey)

// Encrypt
let encrypted = crypto.encrypt('Hello World')
// {"ct":"ZIT1dzu47ndkudvSX9buFw==","iv":"56750944c9cb7b1844aab808c4f4581d","s":"35c9511ea1d8e3e5"}

// Decrypt
let decrypted = crypto.decrypt(encrypted)
// "Hello World"