What is s2k algorithm?

What is the definition of s2k algorithm? For example, "PBKDF2 (SHA-1)" is an s2k algorithm.

Here is the nerd code that references s2k:

  AutoSeeded_RNG rng;

  std::auto_ptr<S2K> s2k(get_s2k("PBKDF2(SHA-1)"));
  s2k->set_iterations(8192);
  s2k->new_random_salt(rng, 8);

  SymmetricKey bc_key = s2k->derive_key(key_len, "BLK" + passphrase);
  InitializationVector iv = s2k->derive_key(iv_len, "IVL" + passphrase);
  SymmetricKey mac_key = s2k->derive_key(16, "MAC" + passphrase);
+5
source share
1 answer

String-to-key (S2K) specifiers are used to convert passphrase strings into encryption / decryption keys with a symmetric key. They are used in two places, currently: for encrypting the secret part of private keys in private keyring, as well as for converting code phrases into encryption keys for symmetrically encrypted messages.

Source (in more detail): http://sunsite.icm.edu.pl/gnupg/rfc2440-3.html

+7

All Articles