You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a template code (main.ml), a block has 2 bytes which is depicted in this comment.
(* 1 block = 2 bytes = 16 bits *)
However, assuming block size as 2 got a wrong answer when executing './aes enc test/key.txt test/iv.txt test/helloworld.txt' in a terminal.
After modifying my code to have block size as same as key or iv, this problem is solved for helloworld.txt. This is because in this case, iv and key block has 3 bytes including new line character, not 2 bytes.
Therefore, I'm curious whether the block size of CBC is determined by key's size(num of bytes for a key).
Also, if key size and iv size are differenct, what should be padded? The iv or the key?
This discussion was converted from issue #258 on December 28, 2024 04:37.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Name: Jaejun Han
I'm curious about block size of CBC in hw2.
In a template code (main.ml), a block has 2 bytes which is depicted in this comment.
(* 1 block = 2 bytes = 16 bits *)
However, assuming block size as 2 got a wrong answer when executing './aes enc test/key.txt test/iv.txt test/helloworld.txt' in a terminal.

After modifying my code to have block size as same as key or iv, this problem is solved for helloworld.txt. This is because in this case, iv and key block has 3 bytes including new line character, not 2 bytes.
Therefore, I'm curious whether the block size of CBC is determined by key's size(num of bytes for a key).
Also, if key size and iv size are differenct, what should be padded? The iv or the key?
Beta Was this translation helpful? Give feedback.
All reactions