You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.
When the user try to authenticate the first time and fail/success, then, try again/logout, the server is stopped and throw this error:
crypto.js:279
var ret = this._binding.update(data, inputEncoding);
^
TypeError: error:00000000:lib(0):func(0):reason(0)
at Decipher.Cipher.update (crypto.js:279:27)
All function well each time restart the app.
The Code:
var algorithm = 'aes-256-cbc';
var inputEncoding = 'utf8';
var outputEncoding = 'hex';
When the user try to authenticate the first time and fail/success, then, try again/logout, the server is stopped and throw this error:
crypto.js:279
var ret = this._binding.update(data, inputEncoding);
^
TypeError: error:00000000:lib(0):func(0):reason(0)
at Decipher.Cipher.update (crypto.js:279:27)
All function well each time restart the app.
The Code:
var algorithm = 'aes-256-cbc';
var inputEncoding = 'utf8';
var outputEncoding = 'hex';
var crypto = require('crypto'),
key = process.env.SUPER_SECRET_KEY,
cipher = crypto.createCipher(algorithm, key),
decipher = crypto.createDecipher(algorithm, key);
exports.cipherData = function(pass){
var encryptedPass = cipher.update(pass, inputEncoding, outputEncoding);
encryptedPass += cipher.final(outputEncoding);
}
exports.decipherData = function(pass){
var decryptedPass = decipher.update(pass, outputEncoding, inputEncoding);
decryptedPass += decipher.final(inputEncoding);
console.log(decryptedPass);
}
The text was updated successfully, but these errors were encountered: