dauhee:
Thank you so much for this extremely useful library. I'm not too "up" on C. Would you have any examples on encrypting a string that is longer than the N_BLOCK?I have hit a stumbling block (no pun intended), and am trying multi-dimentional arrays to create blocks for encrypting/decrypting - I haven't gotten it working so am not even sure if plain and cipher will always be the same length.
Assuming you have padded your plaintext up to a whole number of blocks "blockcount", and
assuming ciphertext is a byte array long enough for that amount of data, and that iv is a block's
worth of initialization vector, the encryption call is
success_flag = aes.cbc_encrypt (plaintext, ciphertext, blockcount, iv);
Similarly for cbc_decrypt. If "iv" and "padding" don't mean anything to you you will need to read up about
block cipher encryption modes - all details matter.
These routines side-effect the iv argument to perform chaining (meaning they can be called repeatedly on groups of blocks
without having to pass around a chaning block explicitly).