4 ms·
yes, is there any reliable place to look for the current "best" practices for keys generation? (as in, good enough for the foreseeable future)
by ekianjo 9y ago
yes, is there any reliable place to look for the current "best" practices for keys generation? (as in, good enough for the foreseeable future)
- grawlinson 9y agoSimilar, but slightly unrelated (SSH keys), I find this one of the best resources to look at: https://wiki.mozilla.org/Security/Guidelines/OpenSSH https://wiki.mozilla.org/Security/Guidelines/OpenSSH
- pfg 9y agohttps://www.keylength.com/ https://www.keylength.com/ presents the recommendations from various best-practice documents for many key types and cryptographic operations.
- RJIb8RBYxzAMX9u 9y agoIf I'm using the comparison tool correctly, then it shows that 2048-bit keys would be fine up to 2020 ~ 2030, and 4096-bit keys beyond ~2022. This is in line with my understanding. FWIW, ssh-keygen(1) generates 2048-bit RSA keys by default[0]. Generally if I had to appeal to authority over security matters, I refer to the OpenBSD / OpenSSH guys. [0] https://man.openbsd.org/ssh-keygen#b https://man.openbsd.org/ssh-keygen#b
- brians 9y agoSSH Keys are for login authentication. If tomorrow we crack RSA-2047, you can replace them before we get to 2048 bits. GPG Keys are for secrecy. If the adversary gets a ciphertext, he can hold it until 2030 and decrypt then. Very different model!
- RJIb8RBYxzAMX9u 9y agoHmm, good point.
- foo101 9y agoI am not convinced they are very different models. My argument: An attacker can save the encrypted SSH traffic going over an insecure channel, then hold the traffic until 2030 and decrypt then. Do you find a flaw in my argument?
- heavenlyhash 9y agoYes. It is, forgive me for being blunt, nearly completely wrong. For starters, there's two different kinds of keys in use: symmetric and asymmetric. The ratio of "bits" to "strength" is completely different for the two categories. Asymmetric keys are typically only used to handle identity, then bootstrap a selection of symmetric keys (which are faster to use, generally); and then the symmetric keys used are typically based on Diffie Hellman key exchange, which is a whole 'nother ball of wax. Which bits you have to hold onto, and what you get when you compromise them, is not a flat field. Compromising the asymmetric keys used for identity at the beginning of communication means you can forge that identity in the future; but it doesn't necessarily mean you get to compromise other communications made with yet other keys which were merely agreed upon under the situational aegis of those asymmetric keys at a previous date.
- cesarb 9y agoWith encrypted SSH traffic, there are normally three kinds of keys involved. The traffic is encrypted with per-connection symmetric keys, usually 256 bits. These keys are obtained through a Diffie–Hellman key exchange or similar, which uses per-connection randomly-generated keys. Finally, the long-term "SSH key" is used to sign these randomly-generated keys (and other things). If you hold the traffic until 2030 and want to decrypt it, you have to break either the symmetric keys, or the key exchange. Breaking the "SSH key" would allow you only to forge a new signature, but that doesn't help decrypting past traffic. That's the difference between the models: a key used for encryption, once broken, allows you to decrypt. A key used for signing, once broken, allows only forgery. And for SSH, forgery must be done while the forged key is still accepted (known_hosts or authorized_keys).
- tialaramex 9y agoGoogle (Perfect) Forward Secrecy There's a mathematical trick (actually these days several different ones, but the original idea is the same) which lets two people agree on a number without either of them saying what the number is OR any witnesses knowing what it is by watching the conversation. If you struggle with high school mathematics look for videos which demonstrate this trick using mixing paint, so you're not distracted by mathematics you don't understand. This trick is routinely used in realtime communications (HTTPS, SSH, secure messaging protocols) to make a throw away transient key [actually usually two and sometimes four] used only for one conversation. Once the communication is over, both parties throw away their transient keys, and even somebody who knows the long term keys can never find out what they were because of Forward Secrecy.
- theyregreat 9y agoSecure Secure Shell guide is a good security baseline, including generating long enough moduli and using EC. https://stribika.github.io/2015/01/04/secure-secure-shell.html https://stribika.github.io/2015/01/04/secure-secure-shell.ht... In the future, recommendations will need to be increased and less secure methods deprecated.
- xelxebar 9y agoI don't know much about the curator, but nacl is apparently on the same domain: http://safecurves.cr.yp.to/ http://safecurves.cr.yp.to/
- kqr 9y agoDaniel J. Bernstein or djb is a very well known crypto expert with no apparent secret agendas.