When we talk about a Number used ONCE (NONCE) in Initialization Vector (IV), is it required to use numbers only? Is is possible to use letters or special characters?

  • 1
    $\begingroup$ An IV or nonce is a sequence of bytes, the concept of letters doesn't make much sense here. So what's your question? Are you talking about the ASCII representation of those bytes? Or the hex representation? $\endgroup$ – CodesInChaos Jul 10 '12 at 11:30
  • 2
    $\begingroup$ It's just a string of bits, how you wish to interpret it is entirely up to you and irrelevant to the actual underlying cryptographic operations being performed (personally I like to use hex. representation for visual inspection as it's easy to compare bitwise, great for debugging) $\endgroup$ – Thomas Jul 10 '12 at 11:40

No. In the context of the Initialization Vector of a cipher operated in some mode, the most significant property of a cryptographic nonce is that it is not reused. It often matters that it is random and unpredictable (e.g. with CBC). It is immaterial that it represents a number or anything else under some particular encoding.

If an IV is chosen at random, it would be bad to restrict it to represent a number (say, restricting each byte to be a digit according to ASCII), in particular because it would dramatically increases the odds of reusing the same IV.

| improve this answer | |
  • $\begingroup$ Removed "standard and best" about random nonce. It is good practice, but other forms of NONCE are also standardized, and "best" is subjective. If a message already has a unique identifier, it is questionable if it is best to use a random instead of the UID. $\endgroup$ – Maarten Bodewes Aug 10 '14 at 16:49
  • $\begingroup$ @owlstead: I'm OK with you change. However, using an UID as IV can be bad: in CBC mode, if the UID is predictable, encryption can be broken under CPA; in CTR mode, if consecutive UIDs differ only in the same low bits that are changed by counting, some keystream is reused. $\;$ In my opinion, the simplest (thus often the best) is: if the key is used for a single session, use implicit zero IV; otherwise use a random IV. $\endgroup$ – fgrieu Aug 10 '14 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.