Thanks Matt.

On that note, do we have support for OCB mode in openssl. Where can i find
the documentation for all the modes supported by openssl??

Regards,
Rohit Bansal


On Mon, Jan 14, 2013 at 1:16 PM, Matt Caswell <fr...@baggins.org> wrote:

> The EVP API is documented here:
> https://www.openssl.org/docs/crypto/EVP_EncryptInit.html#
>
> There is some example code there too. It doesn't use AES or CTR, but the
> principle is the same. Just replace EVP_bf_cbc() with EVP_aes_256_ctr(),
> and ensure you use an appropriately sized key and IV.
>
> Matt
>
>
>
> On 14 January 2013 20:44, Rohit Bansal <banr...@gmail.com> wrote:
>
>> Thanks Matt. Is there a sample code i can look into?
>>
>> In my case the key is unique across different messages, so having same IV
>> across messages should not lead me into problem
>>
>> Thanks,
>> Rohit Bansal
>>
>>
>> On Mon, Jan 14, 2013 at 12:22 PM, Matt Caswell <fr...@baggins.org> wrote:
>>
>>> Yes, you can use CTR mode for AES-256: use the EVP interface with the
>>> EVP_CIPHER of EVP_aes_256_ctr().
>>>
>>> However it is a fundamental requirement of CTR mode that the IV must be
>>> unique across messages. If you reuse the IV then your messages can be
>>> broken quite trivially. Therefore, if by a fixed IV, you mean that it is
>>> fixed across multiple messages then CTR mode is not suitable for you.
>>>
>>> Matt
>>>
>>>
>>> On 14 January 2013 19:25, Rohit Bansal <banr...@gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Can somebody help me if CTR mode is supported in openssl for AES-256
>>>> encryption?
>>>>
>>>> I dont want to use CBC and i have a fixed IV.
>>>>
>>>> Thanks,
>>>> Rohit
>>>>
>>>
>>>
>>
>>
>> --
>> Rohit Bansal
>>
>
>


-- 
Rohit Bansal

Reply via email to