In Advanced Encryption Standard, if I used "Counter Mode", how should I handle the nonce? Should I divide the nonce value into two? For example: I have 128-bit of nonce, should I divide it so I get two parts with 64-bit each?
The first 64-bit is my chosen nonce value (for example a0a1a2a3a4a5a6a7
) and the second 64-bit is the counter (for example 0000000000000001
). Is this correct?
In the sequence of the counter, does it work like the following?
0000000000000001,
0000000000000002,
...
000000000000000f,
0000000000000010,
0000000000000011,
...
00000000000000ff
And… after 00000000000000ff
, what is the next counter value? Is it 000000000000ff00
, followed up like this?
000000000000ff01
000000000000ff02
000000000000ff03
000000000000ff04