[#wallet-EncryptSecret] = xref:wallet.adoc[wallet]::EncryptSecret :relfileprefix: ../ :mrdocs: Encrypts a secret with the master key using the given IV. == Synopsis Declared in `<wallet/crypter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] bool EncryptSecret( xref:wallet/CKeyingMaterial.adoc[CKeyingMaterial] const& vMasterKey, xref:wallet/CKeyingMaterial.adoc[CKeyingMaterial] const& vchPlaintext, xref:uint256.adoc[uint256] const& nIV, std::vector<unsigned char>& vchCiphertext); ---- == Return Value true if encryption succeeded. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *vMasterKey* | The master key used as the encryption key. | *vchPlaintext* | The secret to encrypt. | *nIV* | Source of the initialization vector. | *vchCiphertext* | Receives the resulting ciphertext. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#