A "nonce" is an arbitrary number or string used only once within the context of a specific cryptographic scheme. Nonces are used e.g. in authentication protocols to prevent replay attacks, as well as in stream ciphers (including CTR mode) to avoid keystream reuse.

learn more… | top users | synonyms

4
votes
2answers
185 views

Security of encrypting many short values with AES in GCM mode

We intend to encrypt certain values in a database which holds personal information such as addresses so as to prevent data leakage should the database be compromised. The intention is that each field ...
0
votes
0answers
13 views

Why does HS1-SIV use the universal hash function the second time?

HS1-SIV uses HS1-Hash twice: once with the message as input, and the second time with the authentication tag as input. The second use seems somewhat strange to me: assuming that the core is a strong ...
4
votes
2answers
62 views

Can one extend the nonce of ChaCha/Salsa20 by XORing the extra bits with the key?

Can one extend the ChaCha and Salsa20 nonces by XORing the extra nonce bits with the key? My reasoning is as follows: the Rumba compression function allows attackers to supply any 48-byte input to ...
6
votes
1answer
66 views

Is the 'nonce' in bitcoin really a nonce?

Is the 'nonce' in bitcoin really a nonce? Reading definitions of nonce and salt it seems the number is used as a salt but the same value can occur in multiple blocks; there's no requirement or indeed ...
3
votes
1answer
52 views

Using AES-CTR to generate AES subkeys from a master key and nonce

Suppose I would like to encrypt some data using AES-GCM because it has hardware support on my processor and it is secure. Unfortunately, I don't like the 96-bit nonce size, because I want to randomly ...
2
votes
0answers
156 views

Security implications of public nonce

I'm planning to use the crypto_box() functions of Nacl (or, alternatively, the crypto_box_easy() functions of libsodium) to ...
3
votes
1answer
70 views

Is it acceptable to write the nonce to the encrypted file during AES-256 GCM? [duplicate]

I've used AES-128 in CTR mode in the past and using the same key but different IVs for each file, I wrote the IV to the first 16 bytes. Is it safe to do so with the nonces used in AES-256 GCM? I'm ...
5
votes
1answer
129 views

Streaming mode of operation that is more resistant against nonce reuse

Is it possible to create a streaming mode of operation where the reuse of a nonce does not destroy confidentiality? In this question it would be allowed for the streaming mode to leak if ciphertexts ...
0
votes
0answers
15 views

Why does HS1-SIV not encrypt the SIV with the PMN and key?

HS1-SIV is a good nonce-misuse-resistant, two-pass, AEAD scheme that is part of the CAESAR competition. However, it suffers from forgeries if the SIV collides. It seems to me that encrypting the SIV ...
1
vote
1answer
28 views

Generally accepted algorithm for two-pass, misuse-resistant AEAD that is efficient in software

I would like to know what the standard is for two-pass, nonce-misuse-resistant AEAD that is efficient in software. Thus, AES-SIV is excluded; modes based on a stream cipher like ChaCha20 are ...
5
votes
1answer
89 views

Do Carter–Wegman MACs allow key reuse if the MAC tag is kept secret?

Poly1305 (and GHASH) are secure authenticators, but only for one use. Thus, nonce reuse in Poly1305-AES, ChaCha20-Poly1305, and AES-GCM all reveal the authentication key. However, my understanding ...
5
votes
2answers
632 views

When would you increment a nonce and when not?

K is the shared key for encryption known by _Alice and _Bob. $N_A$ is a nonce created by Alice. The function f is the increment by 1 function. (1) Alice -> Bob: $E_K(N_A)$ So Alice encrypts a nonce ...
1
vote
1answer
104 views

What happens if a nonce is reused in ChaCha20-Poly1305?

In ChaCha20-Poly1305, I know that reusing a nonce loses confidentiality and integrity for all messages encrypted with the (key, nonce) pair. However, is security affected for those messages encrypted ...
5
votes
1answer
61 views

Symmetric encryption algorithms with large IVs and authentication?

Most modern symmetric ciphers require a nonce/IV. If the nonce is reused, security is lost. If the nonce is large enough, it can be generated securely by using a CSPRNG. This avoids needing to keep ...
3
votes
1answer
54 views

Randomness and increment of nonce in GCM

2 questions about nonce usage in GCM: Is it safe to use non-random nonce in GCM? Say I use 0x1 for m1, 0x2 for m2, so on. How much should a nonce increased for a file? Say I use 0x1000 as a nonce to ...
9
votes
1answer
1k views

Why does the crypto_box functionality in NaCl library exposes the nonce to the programmer

The idea of crypto_box API in NaCl library is to shield the programmer away from the technical details and provide easy to use functions for encrypting and encrypting messages. Given what I've just ...
4
votes
1answer
101 views

Using HMAC as a nonce with AES-CTR encrypt-and-MAC

Suppose I use the following encrypt-and-MAC construction: $E(k_1, k_2, n, m) = E_\text{AES256-CTR}(k_1, n, m) \| \text{HMAC-SHA256}(k_2, m)$, where: $k_1$ and $k_2$ are 256-bit keys $n$ ...
9
votes
1answer
606 views

Why do stream ciphers use a nonce?

My question maybe will be stupid, but my problem is that I do not understand why stream ciphers need a key and also a nonce. As far as I understand, the keystream is generated with the nonce. The same ...
0
votes
1answer
70 views

Is a nonce considered 'secret' enough for HMAC?

We're implementing a mobile application which communicates with a web service, and on first install the user sends its deviceid to the web service (over TLS, unauthenticated at this point) - which ...
3
votes
1answer
53 views

How to compromise the privacy of NaCl encrypted messages, when nonce is reused?

I want to know to how break NaCl encryption when a nonce used more than once for a given key private key. According to PyNaCl docs: It is VITALLY important that the nonce is a nonce, i.e. it is a ...
5
votes
2answers
191 views

Picking a nonce in the context of CCM (CTR with CBC-MAC) mode

After having read the RFC 3610: Counter with CBC-MAC (CCM) and the Wikipedia article on CTR mode, I'm not sure how a nonce should be picked. The RFC says: A nonce N of 15-L octets. Within the ...
4
votes
2answers
842 views

Is it secure to concatenate two 16-bit random numbers into a 32-bit one?

I'm working on a security application for RF modules aimed to protect a communication between an autarkic sensor and a line-powered receiver against MITM (man-in-the-middle attacks). I decided to use ...
2
votes
1answer
69 views

Can we use the authentication tag as Nonce / IV for the next message?

Let's assume we're in some scenario requiring transfer of large amounts of data. This means we can only use AES-GCM chunk-for-chunk as its maximal size is restricted to a few GiBs. This means we have ...
2
votes
1answer
70 views

Using scrypt to generate key + IV/nonce together

Is there any security issue in using scrypt for Key + IV/nonce generation? In other words, can I safely use only a salt for scrypt and derive the nonce along with the key? For example: I have data I ...
6
votes
3answers
140 views

Why is it good to split a CTR-mode counter into nonce and counter?

When discussing the CTR mode of block ciphers, Wikipedia says the following: Simply adding or XORing the nonce and counter into a single value would completely break the security under a ...
4
votes
1answer
214 views

64bit nonce in AES-CTR, why not 128?

I'm just a bit confused about the nonce/IV in AES-CTR ... it seems the suggested way to go is have a 64bit random nonce, and use the last 64bits as the counter, "starting at 0". I'm just wondering ...
3
votes
1answer
155 views

EAX cipher mode with nonce equal header

I am using EAX AEAD with an 8-byte message header which carries a 32-bit sequence number, a message length, and some other bits that I don't mind exposing. Assuming the sequence number never repeats ...
2
votes
1answer
218 views

How bad it is using the same IV twice with AES/GCM?

I understand that initialization vectors should not be used twice when using AES/GCM. I am using a counter as initialization vector. Every time I send out a new packet (I am developing an UDP based ...
0
votes
1answer
63 views

What is the proper usage of GCM nonce in TLS1.2?

I have written a program with the help of the bouncy castle for C# library. I am monitoring the traffic which is send between the client and the server and found something (i find) strange. The ...
3
votes
2answers
126 views

Is it OK to use a hash of the key as nonce for AES GCM?

I don't see an immediate risk of using the hash of the key as the nonce for AES GCM. Is there something I could be overlooking?
0
votes
1answer
94 views

Security aspects of using a global values as nonce and additional data for AES? [closed]

is it a good idea to use global values as nonce / additional data? What problems can occur? What should be take in account when we deal with such parameters for encryption. Thanks
2
votes
2answers
923 views

nonce of AES-GCM in SSL

It seems that the nonce of AES-GCM in SSL has 3 parts: salt, 4 bytes, generated in handshake, not changed in whole session nonce_explicit, 8 bytes, chosen by the sender and carried in each SSL ...
0
votes
2answers
57 views

Why does spiped use both nonces and ephemeral keys?

Colin Percival's spiped utility uses a pre-shared key and Diffie-Hellman with ephemeral keys to provide forward secrecy. The protocol is summarized in the ...
-1
votes
1answer
181 views

credit card number encryption using aes-ctr mode

I want to encrypt credit card numbers. I want to apply AES-CTR mode. Is it suitable for that? How can I store nonce and counter values for an individual credit card number? How can I send the ...
1
vote
1answer
42 views

Determining nonce between unsynced systems

It's my first venture into cryptography, and I'm struggling with how to use a nonce in an encryption standard between two digital radios. The two radios support AES encryption, only requiring a ...
0
votes
1answer
163 views

Is it necessary to encrypt nonce in cryptographic communication?

Server and client have a pre-shared key K. Assuming that that pre-shared key is safe, so nobody other than server/client can encrypt/decrypt. Client sends a nonce N to server, server then sends back ...
0
votes
1answer
89 views

Should the nonce passed to GCM be authenticated?

This answer recommends authenticating the IV with HMAC when using AES and then HMAC. Since AES-GCM provides authentication too, should the external nonce passed to GCM be authenticated separately ...
0
votes
1answer
221 views

Nonces being used in SSL and MAC to prevent replay attacks

I'm a bit confused in the way nonces are used in these processes to prevent replay attacks. Heres How I think it works during SSL: Nonces are exchanged during stage one of the handshake protocol. ...
0
votes
1answer
157 views

Using hash of plaintext as nonce in NaCl secretbox- bad idea?

I need a nonce to encrypt my stuff using NaCl secretbox. I will be transmitting the nonce along with the ciphertext, which I have been told is OK to do. It occurs to me that one could simply use the ...
0
votes
1answer
52 views

Is there (this) a case in which salting is dispensable?

tl;dr this is not a duplicate of "what is a salt/why use salt?" question. Instead it is specificly asking when salt may not be necessary for hashing securly? (i.e. when the data being hashed is ...
2
votes
2answers
152 views

I don't care about replay attacks. What should I do with the nonce in nacl?

My system forwards encrypted and/or signed messages on a gossip network. Replay is part of the design. What should I do with the nonce? I'm tempted to just set it to the same number always. Is this a ...
-1
votes
1answer
242 views

what is SALSA20 Nonce and its requirements [duplicate]

what is the source of nonce in SALSA20 algorithm. basically who provides the value of nonce in SALSA20 algorithm
2
votes
1answer
87 views

Can adding nonces make challenge response authentications weaker?

In a custom protocol we want to replace an aged tiger32 based challenge response authentication. I suggested that we use something existing, so threw HMAC into the room. As per wikipedia it works as: ...
1
vote
1answer
113 views

Counter Mode: how to choose the nonce part of the counter? [duplicate]

Suppose: The "counter field" is about: NONCE || CTR-VALUE. I have multiples messages $M_a, M_b, M_c, \dots$ Each message can be divided into x-bits blocks ($M_{a1}, M_{a2}, M_{a3}, \dots$). Each ...
5
votes
3answers
2k views

Difference between a nonce and IV

I know the generic difference between a nonce and an IV. I am specifically looking for a clarification on these terms as used in the "Evaluation of Some Blockcipher Modes of Operation" by Phil ...
2
votes
2answers
261 views

OCB nonce usage

I've just come across this piece of code in Bouncy Castle's implementation of OCB Mode: ...
4
votes
2answers
946 views

Is there a standard way to use a nonce with HMAC?

Many protocols use HMAC on messages that include a nonce, but they don't seem to do it in a consistent way. For example, in OAuth the nonce is in the middle of an URL-encoded key-value string, like ...
4
votes
1answer
195 views

Strategy for random CTR initial counter values

Alice has a secret key which she uses to encrypt messages in CTR mode. CTR mode is critically vulnerable to counter reuse, and Alice has a problem: she has terrible memory and no pen to write anything ...
8
votes
4answers
4k views

What are the requirements of a nonce?

Sometimes I read that a nonce has to be a random number but I disagree. A nonce just can't repeat itself. You could increase in by 1 every time if you are sure it would never repeat.
0
votes
1answer
395 views

CVE-2014-1295 (Apple's Secure Transport and Triple Handshake Attack)

Apple is releasing some updates today. They have not published the bulletins yet, but they are available here: https://gist.github.com/FredericJacobs/11189734. In the writeup for CVE-2014-1295: ...