I\'m trying to simply encrypt a message using a given key and iV. I\'ve tried several libraries to achieve this but Expo isn\'t compatible with any of them. I couldn\'t find any
first use this command :
npm i crypto-es
then now you should import it with this command :
import CryptoES from "crypto-es";
then you should encrypt the text : for example :
var mytexttoEncryption = "Hello"
const encrypted = CryptoES.AES.encrypt(mytexttoEncryption ,"your password").toString();
now for decryption : install the package of crypto-js with this command :
npm i crypto-js
then lets decrypt it
var C = require("crypto-js");
var Decrypted = C.AES.decrypt(E, "your password");
var result =Decrypted.toString(C.enc.Utf8);
console.log(result)
so use this it will be ok