|
libkeepass 0.2.0
KeePass key database importer/exporter library
|
Input streambuf that encrypts on the fly (streaming counterpart of the whole-buffer encrypt_cbc / ChaCha20 path).
More...
#include <stream.hh>
Public Member Functions | |
| encrypt_ostreambuf (std::ostream &dst, Cipher< 16 > &cipher) | |
| Constructs a CBC-mode encrypting streambuf. | |
| encrypt_ostreambuf (std::ostream &dst, ChaCha20Cipher &cipher) | |
| Constructs a ChaCha20 encrypting streambuf. | |
| ~encrypt_ostreambuf () override | |
| Zeroizes the transient plaintext and chaining state. | |
| int | overflow (int c) override |
| Buffers a character, encrypting one block when it reaches capacity. | |
| std::streamsize | xsputn (const char *s, std::streamsize count) override |
| Writes several characters, applying cipher respectively. | |
| int | sync () override |
| Finalizes the stream (PKCS #7 padding for CBC, partial block for ChaCha20). | |
Input streambuf that encrypts on the fly (streaming counterpart of the whole-buffer encrypt_cbc / ChaCha20 path).
Wraps the plaintext in the same ciphertext produced by the existing blocking code: CBC mode with PKCS #7 padding for block ciphers and pure XOR with a 64-byte keystream for ChaCha20. This lets the exporters pipe the XML (and KDBX 4 inner header) directly into the cipher without ever materializing the plaintext or ciphertext in memory.
| keepass::encrypt_ostreambuf::encrypt_ostreambuf | ( | std::ostream & | dst, |
| Cipher< 16 > & | cipher | ||
| ) |
Constructs a CBC-mode encrypting streambuf.
| dst | The output stream receiving the ciphertext. |
| cipher | The 16-byte block cipher used for CBC encryption. |
| keepass::encrypt_ostreambuf::encrypt_ostreambuf | ( | std::ostream & | dst, |
| ChaCha20Cipher & | cipher | ||
| ) |
Constructs a ChaCha20 encrypting streambuf.
| dst | The output stream receiving the ciphertext. |
| cipher | The ChaCha20 cipher used for keystream generation. |