jsencrypt_igor
1.0.6 • Public • Published Installing
Using npm:
$ npm install jsencrypt_igor
Example
export const encryption = (str) => {
const encode = encodeURIComponent(JSON.stringify(str))
const encrypt = new JsEncrypt()
encrypt.setPublicKey(serverPubKey)
const encyptRes = encrypt.encryptLong(encode)
return btoa(encyptRes)
}
export const decryption = (encrypted) => {
const decrypt = new JsEncrypt()
decrypt.setPrivateKey(clientPriKey)
const temp = decrypt.decryptLong(encrypted)
return JSON.parse(decodeURIComponent(temp))
}
Dependencies (0)
Dev Dependencies (1)
Package Sidebar
Install
Weekly Downloads