samedi 26 mai 2018

Implementation of CBC mode of operation of AES

I have an implementation of AES cipher for 128, 192 and 256 bit keys. I'm trying to implement block cipher mode of operations, currently implementing Cipher Block Chaining mode.

I have two questions regarding the implementation of CBC mode:

1. Whether to read file and pass data to cipher function within the cbc() //it implements CBC mode or I can read data and pass blocks of data to cbc(), which one of them should I use and will be secure?

2. CBC mode requires a randomly generated initialization vector aka IV(I'm using a random bytes generator in c++11 for this), since user only enters key at the time of encryption/decryption how can I know what was the intialization vector used when the file was encrypted. Also if I need to give the IV to user, how?

I'm implementing these in C++11.

thanks.

Aucun commentaire:

Enregistrer un commentaire