Last active
May 5, 2021 05:46
-
-
Save hypnguyen1209/279d36c7dff75a0f9103beaf0512901e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CryptoJS = require('crypto-js') | |
const e = { | |
message: "test phát nữa", | |
clientId: null, // type: Number | |
toid: "" // type: String | |
} | |
const getParam = e => { | |
const t = CryptoJS.enc.Base64.parse('kMj/NDripXEt4d7Fm9PlwQ==') | |
const iv = CryptoJS.enc.Hex.parse('00000000000000000000000000000000') | |
const mode = CryptoJS.mode.CBC | |
const padding = CryptoJS.pad.Pkcs7 | |
return CryptoJS.AES.encrypt(JSON.stringify(e), t, { | |
iv, mode, padding | |
}).ciphertext.toString(CryptoJS.enc.Base64) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment