Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nonce operation advice #6

Closed
temoto opened this issue Mar 16, 2020 · 2 comments
Closed

Nonce operation advice #6

temoto opened this issue Mar 16, 2020 · 2 comments

Comments

@temoto
Copy link

temoto commented Mar 16, 2020

Sorry if this generic crypto question is out of scope.

What nonce operation mode would you suggest for a stateful message exchange protocol built on top of secretbox? I can imagine at least two options:

  • generate random nonce in every message, send length and nonce in authenticated clear text
  • hello message as above with another secret nonce in payload, derive all next nonces from that secret payload, send only authenticated length in clear text

My use case is RPC with messages around 50-200 bytes on expensive 3g network, and shaving 24 bytes from each message is definitely worth pursuing.

Thanks for your time.

@kevinburke
Copy link
Owner

Hey, oh gosh, I don't really know, unfortunately. In theory I think any system that ensures nonces don't repeat is sufficient.

@temoto
Copy link
Author

temoto commented Dec 12, 2020

Thank you. I've decided to go TLS route in the end because not feeling confident with custom crypto.

@temoto temoto closed this as completed Dec 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants