What to do with Crypto Now: Practical Guide

Like many, I’ve been going through all the FUD, doom and gloom of pre-quantum crypto being broken with insufficient information (see this HN discussion for context). here are things that I find most practical at this point.

Main idea is to use RSA 4096 keys for SSH authentication and code or document signing where possible.

Why? Speculation in various discussions centres on elliptic curves (namely NIST P-256 and ed25519). P-384 seems better protected, but ultimately susceptible to the same class of attack.

No classical attacks (only quantum) are currently publicly known against RSA 2048, but it was on the way out already.

Hence RSA 4096 seems like the best choice: it has a better safety margin, and the main trade off is performance. However, for both authentication and signing on modern hardware, performance is acceptable for most scenarios (for signing on YubiKey it may take a second instead of near-instant). If it’s not, second best choice is P-384.

In practice, when using it for SSH and if you configured YubiKey based on my guide, it was previously based on RSA 2048. To switch to RSA 4096, you need to

gpg --card-edit
gpg/card> admin
gpg/card> key-attr

    Then pick (1) RSA and 4096, then regenerate the keys.

    Re-apply the touch policy afterwards:

    ykman openpgp keys set-touch aut on
    ykman openpgp keys set-touch sig cached

    Original post is updated accordingly.

    Note once the new keys are generated, corresponding public keys must be updated at their respective locations. Also note that all older keys (signature, authentication, encryption) are lost on regeneration, so you are unable to use old SSH keys to log in, and anything encrypted to the old encryption key becomes unreadable without a backup. So this needs to be planned to avoid lockouts.

    Also, make sure that OpenSSH servers, Gpg4win and SSH clients are at their latest versions, which provide better forward secrecy, including post-quantum key exchange. Up-to-date clients are also required for RSA keys: new OpenSSH servers only accept rsa-sha2-256/512 signatures, which older clients may not support.

    To check what you’re using for TLS, use:

    openssl s_client -servername host \
      -connect host:443 \
      </dev/null 2>/dev/null | openssl \
      x509 -noout -text | grep -E \
      'Public Key Algorithm|ASN1 OID|Public-Key|NIST CURVE'
    

    and then you want to see either

    Public Key Algorithm: rsaEncryption
    Public-Key: (4096 bit)

    (for RSA 4096, note that 3072 is also currently acceptable)
    or

    Public Key Algorithm: id-ecPublicKey
    Public-Key: (384 bit)
    ASN1 OID: secp384r1
    NIST CURVE: P-384

    (for P-384).

    If it’s something else, take your time to reconfigure based on your provider. Note that there are no known classical attacks against P-256, but since it features most in the recent news, I would plan an orderly migration in the near future. I would apply same reasoning to Ed25519.

    Also, if possible, switch to TLS 1.3 only, or if not possible, restrict to stronger ciphers only.

    Note that none of this is enough for post-quantum security. In other words, both RSA 4096 and P-384 are expected to be broken by quantum computing, but so far there is no publicly known indication that needed hardware is anywhere near completion.

    Current support for PQC algorithms is limited in many essential applications. For example, post-quantum authentication or signature keys aren’t available on YubiKeys or other hardware keys yet. At the same time, post-quantum key exchange is already widely available and should be used where present.

    Therefore, the current approach to use RSA 4096 or P-384 for authentication and signing with post-quantum exchange should hopefully be enough for some time. At the same time, once PQC is added to hardware keys, we should be planning to migrate further.

    Leave a comment

    Your email address will not be published. Required fields are marked *