Sent from my iPad
On Dec 4, 2012, at 10:02 AM, "Charles Oliver Nutter (JIRA)" <j...@codehaus.org> wrote: > > > > Charles Oliver Nutter commented on JRUBY-6951 > Unable to encrypt data and then decrypt it in MRI Ruby > It looks like it's an iv issue. After reading > http://stackoverflow.com/questions/8330364/problems-encoding-decoding-using-aes-128-cbc > I added lines to set iv for the cipher to a specific value, rather than > going with defaults. The resulting encrypted output started to match after > that: > > system ~/projects/jruby $ ruby-1.9.3 crypt.rb > message: secret message > encrypted: "\x13[\xA59>\x1EqV&\xEC\x16\xD3V\xFE)=" > encoded: "E1ulOT4ecVYm7BbTVv4pPQ==\n" > decoded: "\x13[\xA59>\x1EqV&\xEC\x16\xD3V\xFE)=" > decrypted: secret message > > system ~/projects/jruby $ jruby crypt.rb > cipher: aes/cbc/PKCS5Padding > cipher: AES/CBC/PKCS5Padding > message: secret message > encrypted: "\x13[\xA59>\x1EqV&\xEC\x16\xD3V\xFE)=" > encoded: "E1ulOT4ecVYm7BbTVv4pPQ==\n" > decoded: "\x13[\xA59>\x1EqV&\xEC\x16\xD3V\xFE)=" > cipher: aes/cbc/PKCS5Padding > cipher: AES/CBC/PKCS5Padding > cipher: AES/CBC/PKCS5Padding > decrypted: secret message > I'll look into default iv and see if there's something we should be doing > differently. > > This message is automatically generated by JIRA. > If you think it was sent incorrectly, please contact your JIRA administrators. > For more information on JIRA, see: http://www.atlassian.com/software/jira > To unsubscribe from this list please visit: > > http://xircles.codehaus.org/manage_email