gpg.conf could have better defaults for private key encryption
Originally created by @emmapeel on #9511 (Redmine)
reported by user (kinda cryptic for me):
User claims that our gpg.conf file could have a better algo for
encryption of private keys.
As there are no settings about sk2, then GnuPG will use its default
settings, that are:
s2k-cipher-algo CAST5
s2k-digest-algo SHA1
s2k-mode 3
s2k-count 65536
And user claims they better be:
s2k-cipher-algo AES256
s2k-digest-algo SHA512
s2k-mode 3
s2k-count 65011712
As per https://www.gnupg.org/documentation/manuals/gnupg/OpenPGP-Options.html
In this way, the private key material will be encrypted with algo AES256, hash SHA512, and iterating the hash 65011712 times.
Here the references for the algo numbers:
https://www.ietf.org/rfc/rfc2440.txt
I checked with a friend and:
- maybe the overhead of s2k-count 65011712 will eat a lot of CPU
- Also ‘s2k-mode 3’ may be superfluous as it is covered by the defaults
But maybe ‘s2k-cipher-algo AES256’ and ‘s2k-digest-algo SHA512’ are good to have.
Is this something we should report upstream? I could submit a patch for duraconf git, but maybe I should ask GnuPG people to change the defaults?
Related issues
- Related to #12178 (closed)