From: Tony Arcieri Date: 2012-06-29T03:38:51+09:00 Subject: Re: AES Standard Examples confusion --000e0cd4bdc86bbab204c38ca410 Content-Type: text/plain; charset=ISO-8859-1 It uses padding per default: http://ruby-doc.org/stdlib-1.8.7/libdoc/openssl/rdoc/OpenSSL/Cipher.html#method-i-padding-3D If your plaintext is a multiple of the block size you can do cipher.padding = 0 to shut it off On Tue, Jun 26, 2012 at 12:12 PM, Spencer Roan wrote: > Thanks for the feedback! > > I've ripped out the base64 encoding decoding, though i'll be providing > wrapper methods for that once I get everything sorted out. > > I am now converting the strings from hexdigest to hex strings and things > are much better! > > All of the specs pass except those having to do with CBC cipher mode. > > For CBC > decrypting after encrypting gets me back what I started with. Yay. > expected cipher_text is a substring of the actual cipher_text. ??? > expected cipher_text is 16 characters long, the actual is 32 characters > long. hrm... > > This is puzzling. I suppose I could have copied the examples > incorrectly, but the lengths of all of the the cbc fields seems > consistent with the other cipher modes. > > -- > Posted via http://www.ruby-forum.com/. > > -- Tony Arcieri --000e0cd4bdc86bbab204c38ca410 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It uses padding per default:

http://ruby-doc.org/stdlib-1.8.7/libdoc/openssl/rdoc/OpenSSL/Cipher.html= #method-i-padding-3D

If your plaintext is a multiple of the block size you c= an do cipher.padding =3D 0 to shut it off




--
= Tony Arcieri

--000e0cd4bdc86bbab204c38ca410--