

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 4
click for more info
Not enough gems
Cost: 6 gems
1: Advanced Encryption Standard
incomplete
2: Advanced Encryption Standard
incomplete
3: Nonces
incomplete
4: Nonce Review
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
We talked a bit about nonces when we talked about IVs, but let's take a closer look at them.
A nonce is an arbitrary number that must be used only once in a cryptographic communication. Nonces are not secret and can be transported publicly.
Because we use AES-256 at Passly, we're very concerned about using truly random nonces so we don't accidentally reuse one. Write the nonceStrength function. It should return the strength of a nonce as an integer.
We refer to the strength of a nonce as the total number of possible combinations of bits that could exist in the nonce.
0b10010100
0b00010001
0b11000000
All three of these nonces have a strength of 256 because there are 256 possible combinations of bits that could exist in an 8-bit nonce.