> From: owner-openssl-us...@openssl.org On Behalf Of Hazel John > Sent: Friday, 04 September, 2009 11:40
> On Thu, Sep 3, 2009 at 6:36 PM, Dave > Thompson<dave.thomp...@princetonpayments.com> wrote: > > commandline enc does PKCS5 block padding (at least for block modes) > > unless you specify -nopad (and then you can only do full > block data). > > EVP does this (if enabled) but the cipher-level primitives don't. > > Either do padding yourself; have EVP do padding; or use enc -nopad. > > I tried enc -nopad and used 16 byte input for both, but it > still failed. I'm surprised; that worked for me i.e. gave exact same result. > Anyway, I finally decided to take advantage of the openssl > CVS repository, tweaked my encrypt/decrypt to mimic the steps > that openssl takes with my specific parameters. Changed it > to look at a c++ string instead of reading/writing to file > and it finally worked :) Thanks for all the help. (I don't think the code in this area has changed in a while, so the release tars should be equally good. "Six of one.") Glad it worked. Files should work too (although it's up to you whether you need or even want them) but something to check: You said you want no whitespace, which includes linebreaks. Check your file doesn't have a CRLF (or NL on Unix) at the end; its easy to include one without noticing since it's invisible. (Some text editors even add it automatically, though IME usually not ones used on modern Windows, if that's what you are using.) And if you ever do want to handle files having linebreaks on nonUnix systems, be aware that C and C++ handle them differently in "text" versus "binary" I/O. Cheers. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org