Skip to content
instance method

OpenSSL::Cipher#pkcs5_keyivgen

(::String pass, ?::String salt, ?::Integer iterations, ?::String digest) -> void
cipher.pkcs5_keyivgen(pass, salt = nil, iterations = 2048, digest = "MD5") → nil

Generates and sets the key/IV based on a password.

WARNING: This method is deprecated and should not be used. This method corresponds to EVP_BytesToKey(), a non-standard OpenSSL extension of the legacy PKCS #5 v1.5 key derivation function. See OpenSSL::KDF for other options to derive keys from passwords.

Parameters

  • salt must be an 8 byte string if provided.

  • iterations is an integer with a default of 2048.

  • digest is a Digest object that defaults to ‘MD5’

See also #padding= #random_iv #name #random_key also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0