wallet::CCrypter::SetKeyFromPassphrase

Derives the encryption key and IV from a passphrase and salt.

Synopsis

Declared in <wallet/crypter.h>

[[nodiscard]]
bool
SetKeyFromPassphrase(
    SecureString const& key_data,
    std::span<unsigned char const> salt,
    unsigned int rounds,
    unsigned int derivation_method);

Return Value

true if the key was derived and set successfully.

NOTE

The return value should not be discarded.

Parameters

NameDescription
key_dataThe passphrase to derive the key from.
saltThe salt to mix into the derivation.
roundsThe number of derivation rounds to perform.
derivation_methodThe derivation method to use (0 = SHA-512).