-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when encrypt #47
Comments
Getting same error, have you found any solutions? |
I also had this issue, my key + IV used had special characters in, i.e an If you just a normal alphanumeric key + IV, i.e say
|
Im getting the same error. i let my code here, if you found any solution please let me know. function buildSign(data, config) {
try {
encryptData(data.toString(), config)
.then(({ cipher, iv }) => {
console.log('Encrypted:', cipher)
Aes.hmac256(cipher, config).then(hash => {
console.log('HMAC', hash)
})
})
.catch(error => {
console.log(error)
})
} catch (e) {
console.error(e)
}
//return crypto.createHmac('sha256', config.API_SECRET).update(data).digest('hex');
} Thank you so much! |
same issue, but apparently you should try to generate a random key rather then passing your own key, that was the issue for me i added my own key that had apparently invalid caracters, use this instead const handleSubmitForm = async (values, hash) => {
}; |
As far as I can see, this means we can't use this package as a drop in replacement for nodejs version of crypto or use it alongside nodejs. E.g, if a developer needs to use |
Error: exception decoding Hex string: invalid characters encountered in Hex string
The text was updated successfully, but these errors were encountered: