Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

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?

share|improve this question
1  
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? –  CodesInChaos Jul 10 '12 at 11:30
2  
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) –  Thomas Jul 10 '12 at 11:40

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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. –  Maarten Bodewes - owlstead Aug 10 at 16:49
    
@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. –  fgrieu Aug 10 at 23:41

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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