Please help me resolve this problem.
var key = 'real secret keys should be long and random';
// Create an encryptor:
var encryptor = require('simple-encryptor')(key);
var encrypted = encryptor.encrypt('testing');
// Should print gibberish:
console.log('encrypted: %s', encrypted);
I'm using library: "simple-encryptor" on "NPM", but each time I run "encrypt" function, it will output difference result.
Ex:
1st: "4792f3eacff628801005f14f1bc25ba0353…3e969662c4i/It97adse8M+1tmRHnYCQ=="
2nd: "6c576df521df45cc48ffe594fbe13084353…66e3552bdaLoAV3rortuDbJYox1+lVWQ=="
and so on.
(You can run sample code on : https://npm.runkit.com/simple-encryptor )
Therefore: when I save data to local & come back I can't decrypt this data.
Why result of encrypts are different each time I run ?
How to decrypt data in this case ?