s2k
s2k (string-to-key) is the pgp routine that turns your passphrase into the actual encryption key protecting your private key file - slow on purpose.
s2k, short for string-to-key, is openpgp's family of algorithms for converting a human passphrase into a symmetric key. its main job in practice: encrypting your private key at rest, so a stolen key file is useless without the passphrase you chose.
the classic variant is iterated-and-salted s2k: a random salt is mixed into your passphrase and the hash runs not once but millions of times, with a configurable iteration count. this is deliberate cost inflation - an attacker brute-forcing passphrases pays the same delay per guess you pay once per unlock.
the practical takeaway is that passphrase quality still dominates. s2k stretching buys you margin, not immunity: a dictionary password behind a million iterations falls faster than a genuinely random one behind ten. that is why our passphrase generator leans toward long word combos with honest entropy numbers rather than punctuation soup.
newer openpgp (rfc 9580, 2024) added modern password hashing options like argon2 alongside legacy s2k, but the principle is identical - stretch the passphrase so guessing is expensive. if a tool ever imports your key without asking for a passphrase, that key is stored unencrypted, and you should regenerate rather than trust it.