G2A Many GEOs
SHARE
TWEET

AES encrypt

krot Jun 7th, 2019 (edited) 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script src="https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.min.js"></script>
  2. function AESencrypt(str,KEY,IV) {
  3.     key = CryptoJS.enc.Utf8.parse(KEY);
  4.     var iv= CryptoJS.enc.Utf8.parse(IV);
  5.     var encrypted = CryptoJS.AES.encrypt(str, key, {iv:iv,  mode: CryptoJS.mode.CBC });
  6.     return encrypted.toString();
  7. }
  8. function AESdecrypt(str,KEY,IV) {
  9.     var key = CryptoJS.enc.Utf8.parse(KEY);
  10.     var iv=    CryptoJS.enc.Utf8.parse(IV);
  11.     var decrypted = CryptoJS.AES.decrypt(str,key,{iv:iv, mode: CryptoJS.mode.CBC});
  12.     return decrypted.toString(CryptoJS.enc.Utf8);
  13. }
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top