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 encrypt a 1000x block size file (128,000bits). Then should the next safe nonce to use for the next file be simply 0x1001, or after addition of the number of blocks used, i.e. 0x2000?
Is it safe to use non-random nonce in GCM? Say I use 0x1 for m1, 0x2 for m2, so on.


It is perfectly safe to use a non-random nonce in GCM, as long as you never reuse a nonce for two different messages.  So, if you use the message count for the nonce, that's fine; if you accidentally forget that you used nonce 0x5 for a message, and use that again, well, that's not so fine.


  How much should a nonce increased for a file?


The file size doesn't matter; use any increment you want (other than 0).  You don't have to increment the nonce more for large files.