wallet::EncryptSecret

Encrypts a secret with the master key using the given IV.

Synopsis

Declared in <wallet/crypter.h>

[[nodiscard]]
bool
EncryptSecret(
    CKeyingMaterial const& vMasterKey,
    CKeyingMaterial const& vchPlaintext,
    uint256 const& nIV,
    std::vector<unsigned char>& vchCiphertext);

Return Value

true if encryption succeeded.

NOTE

The return value should not be discarded.

Parameters

NameDescription
vMasterKeyThe master key used as the encryption key.
vchPlaintextThe secret to encrypt.
nIVSource of the initialization vector.
vchCiphertextReceives the resulting ciphertext.