请帮我解决这个问题。
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);
我在“NPM”上使用库:“simple-encryptor”,但每次我运行“加密”功能时,它都会输出不同的结果。
例如:
第一:“4792f3eacff628801005f14f1bc25ba0353…3e969662c4i/It97adse8M+1tmRHnYCQ==”
第二:“6c576df521df45cc48ffe594fbe13084353…66e3552bdaLoAV3rortuDbJYox=
1 (您可以在: https
://npm.runkit.com/simple-encryptor
上运行示例代码)
因此:当我将数据保存到本地并返回时,我无法解密这些数据。
为什么每次运行时加密的结果都不同?
在这种情况下如何解密数据?