react-native-aes icon indicating copy to clipboard operation
react-native-aes copied to clipboard

Presenting problems to Encrypt data with the README demo

Open gasparnd opened this issue 2 years ago • 0 comments

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;
};

gasparnd avatar Oct 11 '23 19:10 gasparnd