[#wallet-CCrypter-Encrypt] = xref:wallet.adoc[wallet]::xref:wallet/CCrypter.adoc[CCrypter]::Encrypt :relfileprefix: ../../ :mrdocs: Encrypts plaintext key material with the configured key and IV. == Synopsis Declared in `<wallet/crypter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] bool Encrypt( xref:wallet/CKeyingMaterial.adoc[CKeyingMaterial] const& vchPlaintext, std::vector<unsigned char>& vchCiphertext) const; ---- == 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 | *vchPlaintext* | The key material to encrypt. | *vchCiphertext* | Receives the resulting ciphertext. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#