[cs631apue] How to use iv xor with first block of text

Fabian Foerg ffoerg at stevens.edu
Sun Dec 8 17:51:39 EST 2013


EVP_BytesToKey behaves as expected.

AES-256 uses keys of size 256 bits, but AES has a fixed block size
of 128 bits, regardless of the key size.
The size of the IV must match the block size which is 128 bits = 16 bytes.

Fabian


On 12/08/2013 01:24 PM, Kun Yao wrote:
> Hi, I have following problem in initialisation vector(IV) XOR with first
> block of text,
>
> The assignment ask us for aes-256-cbc mode, that's means we encrypt/de
> 32 bytes of block text each time, but I got 16 bytes of IV by using
> EVP_BytesToKey with SHA1, the SHA1 could generate 160bit, witch is also
> not enough for XOR with 256bit of text. SHA256 is just fit. but
> assignment ask us use SHA1.
> After searching online, I found that the evp.h define the
> EVP_MAX_IV_LENGTH is 16 bytes, even when I used SHA256, EVP_BytesToKey
> still generate 16 bytes. so I don't know how to XOR between IV and text
> with different length now.
>
> Any ideas?
> Thank you.
> Kun
>
>
> _______________________________________________
> cs631apue mailing list
> cs631apue at lists.stevens.edu
> https://lists.stevens.edu/mailman/listinfo/cs631apue
>


More information about the cs631apue mailing list