Null pointer iv with non-EBC block cipher

I’m not sure if this is an openssl problem with not checking for null
before dereferencing pointers, but with ruby you can do the following
cbc block cipher without specifying an IV:

require ‘openssl’
key = “0599E113A7EE32A9”
data =

c1 =“DES-CBC”)
c1.padding = 0
c1.key = key
e = c1.update data
e <<

c2 =“DES-CBC”)
c2.padding = 0
c2.key = key
d = c2.update e
d <<

puts d

This works in MRI, but I don’t believe it should because the user didn’t
specify an IV. IMHO, this is a bug. The responsibility may be openssl
though for not raising the exception. Any thoughts?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs