I'm using crypto-js library:
https://github.com/brix/crypto-js
I want to encrypt some value and decrypt them.
but it returns wrong output.
my codes:
import CryptoAES from 'crypto-js/aes'
componentDidMount(){
var ciphertext = CryptoAES.encrypt('my message', 'secret key 123');
var _ciphertext = CryptoAES.decrypt(ciphertext, 'secret key 123');
console.log(_ciphertext.toString(CryptoAES.Utf8));
}
but my console doesn't return my message. it returns like this:
6d79206d657373616765

cannot read property 'Utf8' of undefined