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

Why have unidirectional symmetric keys? #77

Closed
macaba opened this issue Jan 14, 2019 · 2 comments
Closed

Why have unidirectional symmetric keys? #77

macaba opened this issue Jan 14, 2019 · 2 comments

Comments

@macaba
Copy link

macaba commented Jan 14, 2019

I'm in the process of implementing a non-gaming related library for AEAD-secured DTO transfer between micro-services. I took a look at the netcode.io 1.02 standard.md and I can see the sense in virtually all of it, but there is one aspect I don't yet understand.

The connect token establishes 2 keys:

[client to server key] (32 bytes)
[server to client key] (32 bytes)

This has the effect of making the data transfer unidirectional for a given key.
What benefit does this have?
In my current understanding, if the client and server shared the same key [per unique server-client pair] (which has been established out-of-band over a secure side channel) to allow bidirectional comms with the same key, this wouldn't degrade the security but I suspect there is something I don't yet understand.

Thank you!

@macaba
Copy link
Author

macaba commented Jan 14, 2019

Got it.
You're using ChaCha20, which uses a sequence nonce, not a random nonce like XChaCha20, which is what I've been looking at.
So you need to prevent nonce reuse in either direction.

@macaba macaba closed this as completed Jan 14, 2019
@gafferongames
Copy link
Contributor

Yes and it seemed cleaner than just say, setting high bit on nonce in one direction and zero in the other.

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