Answers for "encriptar exadecimal con cryptojs"

0

encriptar exadecimal con cryptojs

import CryptoJS from 'crypto-js'
import AES from 'crypto-js/aes'

const SECRET = 'I am batman'
const plainText = 'This is Sparta!'

export function enc(plainText){
    // returns something like this U2FsdGVkX184He5Rp991JYAiCSdTwfZs8T3kJUk3zAc=  
    // but with random `/` and I dont want that
    // I want it to be Hex but .toString(CryptoJs.enc.Hex) 
    // is not working, it just returns an '' empty string
    // it's a string, I checked using typeof
    return AES.encrypt(plainText, SECRET).toString();
}
Posted by: Guest on August-27-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language