Mayorga, --- "Mayorga, Armando CTR NIOC Norfolk N361" <[EMAIL PROTECTED]> wrote:
> Hello all, > Could someone please clarify this for me and correct > me if I am wrong > > I am using AES_encrypt and AES_decrypt which > apparently only work on > chunks of 16 bytes of data, my goal is to create my > own functions to > encrypt strings, so I am chunking the strings into > 16 bytes and feeding > them one at a time into AES_encrypt then taking the > output and using > strncat to put it into a buffer. Once done looping > though all of the > chunks I then return the buffer. > > > Now I pass it on to my decrypt function using > AES_decrypt and feed it 16 > bytes at a time from the input buffer, but I get > garbage out. I suggest you use the evp interface if you can help it. You can avoid these problems. Moreover you should check for decrypt errors since if you don't follow padding conventions most of the time you will know by checking the result of decryption. Padding is handled transparently by evp interface. If you use AES_* functions, you have to manually add and remove padding. It is easy to do. Take a look at how evp does it. Also don't use string functions. HTH, Girish > > Am I missing something?, or perhaps I am doing this > the wrong way? > > I would submit code but I have it all hacked up > right now trying to > figure this out > > Thanks in advance, > > AJ > ______________________________________________________________________ > OpenSSL Project > http://www.openssl.org > User Support Mailing List > openssl-users@openssl.org > Automated List Manager > [EMAIL PROTECTED] > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]