Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was confused about libsodium/NaCl APIs, specifically crypto_sign vs crypto_auth. The difference:

1. `crypto_auth` is for secret-key signatures (auth): https://download.libsodium.org/doc/secret-key_cryptography/s...

2. `crypto_sign` is for public-key signatures: https://download.libsodium.org/doc/public-key_cryptography/p...

And tptacek is arguing secret (symmetric) key is preferable: https://news.ycombinator.com/item?id=13866983



Symmetric signature is simpler, leaner (in message size overhead), faster and more secure (by virtue of it being simpler).

But there are still cases where you would choose asymmetric signatures over symmetric signature, due to the very essence of it being asymmetric.

The rule of thumb is that when you want to produce a cryptographic token that will be consumed by parties which you don't trust, you should use an asymmetric signature. Realistically speaking, the untrusted party could (and very often should) be almost any other service inside your own company. If you let symmetric keys spread around, you should treat them as good as if they've been leaked.

There is an alternative that if you're able to (and willing to) manage shared secrets through a safe out-of-band channel (e.g. deriving from client secrets).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: