In message <[EMAIL PROTECTED]> on Mon, 11 Oct 2004 11:11:07 +0000, "Brian Murphy" 
<[EMAIL PROTECTED]> said:

brian_731> Hi
brian_731> 
brian_731> The text "some text 123" in file named test.txt was encrypted with the 
brian_731> following command
brian_731> 'openssl enc -aes128 -in test.txt -out test.enc -e -a -pass pass:secretpass'
brian_731> producing the following ciphertext in file test.enc
brian_731> U2FsdGVkX18mIAVV3TboGOejkyD0b9XGmr0MqwHIuEw=
brian_731> 
brian_731> I am now trying to decrypt this ciphertext using the
brian_731> openSSL libraries rather than the openSSL command line
brian_731> utility. Being new to the library, if anyone could help me
brian_731> out, I'd much appreciate it. I have been attempting to
brian_731> decrypt it using AES_set_decrypt_key() and AES_decrypt()
brian_731> functions but have been unsuccessful so far. What I am
brian_731> looking for is some code samples.

Have you looked at how you read in test.enc?  You see, since you got
it encoded with Base64 (that's what the -a flag does), you need to
decode the contents of test.enc using the Base64 BIO and feed the
result to AES_decrypt().

I know you're looking for code samples.  Unofortunately, my time is
too short to provide that, but I thought a hint in the right direction
could still help.

Cheers,
Richard

-----
Please consider sponsoring my work on free software.
See http://www.free.lp.se/sponsoring.html for details.

-- 
Richard Levitte                         [EMAIL PROTECTED]
                                        http://richard.levitte.org/

"When I became a man I put away childish things, including
 the fear of childishness and the desire to be very grown up."
                                                -- C.S. Lewis
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to