I want to know is there any way to derive the initialization vector, if I know all the other details.
AES SHA 256bits CBC pkcs5padding
Input: Hello
Key: 123
Output: xORGCDL88sa8cUrK8JNSCQ==
Now, how to find IV?
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It only takes a minute to sign up.
Sign up to join this communityI want to know is there any way to derive the initialization vector, if I know all the other details.
AES SHA 256bits CBC pkcs5padding
Input: Hello
Key: 123
Output: xORGCDL88sa8cUrK8JNSCQ==
Now, how to find IV?
I want to know is there any way to derive the initialization vector, if I know all the other details.
Well, the first block (16 bytes for AES) of CBC mode encryption is defined as:
$$C_0 = E_k( IV \oplus P_0 )$$
where $P_0$ is the first block of the padded plaintext, and $C_0$ is the first block of the ciphertext.
If you know $C_0, P_0, k$, then you can rearrange this into:
$$IV = P_0 \oplus D_k( C_0 )$$
where $D_k$ is the AES transform in decryption mode, based on key $k$.
This allows you to rederive the IV directly.