react-native-aes
react-native-aes copied to clipboard
Presenting problems to Encrypt data with the README demo
I have an app with React Native v0.71.8 and "react-native-aes-crypto": "^3.0.1"
I cannot Encrypt data with the demo code in the Readme:
const encryptData = (text, key) => {
return Aes.randomKey(16).then((iv) => {
return Aes.encrypt(text, key, iv, "aes-256-cbc").then((cipher) => ({
cipher,
iv,
}));
});
};
export const decryptData = async () => {
const res = encryptData("Flexit", "test34");
return res;
};