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
I have a problem converting the cipher text which is encrypted in Ruby using AESCrypt using NodeJS nodejs-aes256. I've modified a little nodejs-aes256 as it is appending IV in the begining and Ruby is not appending it.
Now, when I try to decrypt Ruby encrypted cipher in NodeJS, I'm getting the following error:
Error: error:06065064:digitalenvelope routines:EVP_DecryptFinal_ex:baddecryptatDecipher.final(crypto.js:157:26)atObject.aes256.decrypt(/Users/GowthamSai/node_modules/nodejs-aes256/nodejs-aes256.js:27:27)
at repl:1:9atrealRunInThisContextScript(vm.js:22:35)atsigintHandlersWrap(vm.js:98:12)atContextifyScript.Script.runInThisContext(vm.js:24:12)atREPLServer.defaultEval(repl.js:313:29)atbound(domain.js:280:14)atREPLServer.runBound[aseval](domain.js:293:12)atREPLServer.onLine(repl.js:513:10)
And the same, when I try to decrypt the one which is encrypted by node in Ruby, the following error is occurring:
OpenSSL::Cipher::CipherError:
from /Users/GowthamSai/.rvm/gems/ruby-2.2.2/gems/aescrypt-1.0.0/lib/aescrypt.rb:61:in`final' from /Users/GowthamSai/.rvm/gems/ruby-2.2.2/gems/aescrypt-1.0.0/lib/aescrypt.rb:61:in `decrypt_data' from /Users/GowthamSai/.rvm/gems/ruby-2.2.2/gems/aescrypt-1.0.0/lib/aescrypt.rb:38:in `decrypt'from(irb):46from/Users/GowthamSai/.rvm/rubies/ruby-2.2.2/bin/irb:11:in `<main>'
We have a cookie which is set by backend (Ruby) encrypted and I'm trying to send the cookie another service which is (Node) trying to decrypt there.
PS: I can't use IV in backend ( where the cookie is set by) as we have millions of users, and once we deploy with IV, we won't be able to identify the users and face problems. I don't wanna take risk.
I guess it's the problem of padding used in these 2 languages. But i'm not pro to really understand what's happening behind the scenes..
Thanks in advance :)
The text was updated successfully, but these errors were encountered:
General questions like this should be asked on the nodejs/help issue tracker instead. This issue tracker is for node core bug reports, feature requests, etc.
I have a problem converting the cipher text which is encrypted in Ruby using AESCrypt using NodeJS nodejs-aes256. I've modified a little nodejs-aes256 as it is appending IV in the begining and Ruby is not appending it.
So here is my nodejs-aes256:
In Ruby, the same thing is done the following way:
Now, when I try to decrypt Ruby encrypted cipher in NodeJS, I'm getting the following error:
And the same, when I try to decrypt the one which is encrypted by node in Ruby, the following error is occurring:
We have a cookie which is set by backend (Ruby) encrypted and I'm trying to send the cookie another service which is (Node) trying to decrypt there.
PS: I can't use IV in backend ( where the cookie is set by) as we have millions of users, and once we deploy with IV, we won't be able to identify the users and face problems. I don't wanna take risk.
I guess it's the problem of padding used in these 2 languages. But i'm not pro to really understand what's happening behind the scenes..
Thanks in advance :)
The text was updated successfully, but these errors were encountered: