I need to use CBC with ciphertext stealing.

I found the following on Wikipedia:

CBC ciphertext stealing encryption using a standard CBC interface
1. Encrypt the plaintext through the last full block using the standard CBC
mode. 
2. Pad the last partial block with the trailing ciphertext of the last full
block 
3. Encrypt the last block (plaintext plus ciphertext) 
4. Swap the last two ciphertext blocks. 
5. Truncate the ciphertext to the length of the original plaintext. 

Reading the AES_cbc_encrypt() code, it seems to me that it already does
steps 1-3.
So I think all I have to do is:
- call AES_cbc_encrypt() with the entire plaintext.
- perform 4 and 5 on the result.

Am I correct or am I missing something?

I found some implementation of AES_cts_encrypt() here:
http://ftp.scythe.jp/pub/2005/aes_cts_openssl-20051128.c
http://ftp.scythe.jp/pub/2005/aes_cts_openssl-20051128.c 
but for some reason it performs all steps itself, so I'm a little unsure.

Thanks for any help!


-- 
View this message in context: 
http://www.nabble.com/AES-cbc--How-to-Init-Openssl--tf4376933.html#a12793433
Sent from the OpenSSL - User mailing list archive at Nabble.com.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to