[#wallet-CCrypter-SetKeyFromPassphrase] = xref:wallet.adoc[wallet]::xref:wallet/CCrypter.adoc[CCrypter]::SetKeyFromPassphrase :relfileprefix: ../../ :mrdocs: Derives the encryption key and IV from a passphrase and salt. == Synopsis Declared in `<wallet/crypter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] bool SetKeyFromPassphrase( xref:SecureString.adoc[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 https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *key_data* | The passphrase to derive the key from. | *salt* | The salt to mix into the derivation. | *rounds* | The number of derivation rounds to perform. | *derivation_method* | The derivation method to use (0 = SHA‐512). |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#