#include <CipherStream.h>
Inherited by ibrcommon::AES128Stream, and ibrcommon::XORStream.
Public Types | |
| enum | CipherMode { CIPHER_ENCRYPT = 0, CIPHER_DECRYPT = 1 } |
Public Member Functions | |
| CipherStream (std::ostream &stream, const CipherMode mode=CIPHER_DECRYPT, const size_t buffer=2048) | |
| virtual | ~CipherStream () |
| void | encrypt (std::iostream &stream) |
| void | decrypt (std::iostream &stream) |
Protected Member Functions | |
| virtual void | encrypt (char *buf, const size_t size)=0 |
| virtual void | decrypt (char *buf, const size_t size)=0 |
| virtual void | encrypt_final () |
| virtual void | decrypt_final () |
| virtual int | sync () |
| virtual int | overflow (int=std::char_traits< char >::eof()) |
Protected Attributes | |
| CipherMode | _mode |
Definition at line 17 of file CipherStream.h.
Definition at line 20 of file CipherStream.h.
| ibrcommon::CipherStream::CipherStream | ( | std::ostream & | stream, | |
| const CipherMode | mode = CIPHER_DECRYPT, |
|||
| const size_t | buffer = 2048 | |||
| ) |
Definition at line 12 of file CipherStream.cpp.
| ibrcommon::CipherStream::~CipherStream | ( | ) | [virtual] |
Definition at line 18 of file CipherStream.cpp.
| void ibrcommon::CipherStream::decrypt | ( | std::iostream & | stream | ) |
* decrypt a seekable stream by reading and writing into the same stream
| stream | ||
| key | ||
| salt | ||
| iv | ||
| tag |
Definition at line 47 of file CipherStream.cpp.
References decrypt_final().
Referenced by overflow().

| virtual void ibrcommon::CipherStream::decrypt | ( | char * | buf, | |
| const size_t | size | |||
| ) | [protected, pure virtual] |
Implemented in ibrcommon::AES128Stream, and ibrcommon::XORStream.
| virtual void ibrcommon::CipherStream::decrypt_final | ( | ) | [inline, protected, virtual] |
Definition at line 51 of file CipherStream.h.
| void ibrcommon::CipherStream::encrypt | ( | std::iostream & | stream | ) |
encrypt a seekable stream by reading and writing into the same stream
| stream | ||
| key | ||
| salt |
Definition at line 23 of file CipherStream.cpp.
References encrypt_final().
Referenced by overflow().

| virtual void ibrcommon::CipherStream::encrypt | ( | char * | buf, | |
| const size_t | size | |||
| ) | [protected, pure virtual] |
Implemented in ibrcommon::AES128Stream, and ibrcommon::XORStream.
| virtual void ibrcommon::CipherStream::encrypt_final | ( | ) | [inline, protected, virtual] |
Definition at line 50 of file CipherStream.h.
| int ibrcommon::CipherStream::overflow | ( | int | c = std::char_traits<char>::eof() |
) | [protected, virtual] |
Definition at line 92 of file CipherStream.cpp.
References _mode, CIPHER_DECRYPT, CIPHER_ENCRYPT, decrypt(), and encrypt().
Referenced by sync().

| int ibrcommon::CipherStream::sync | ( | ) | [protected, virtual] |
Definition at line 71 of file CipherStream.cpp.
References _mode, CIPHER_DECRYPT, CIPHER_ENCRYPT, decrypt_final(), encrypt_final(), and overflow().

CipherMode ibrcommon::CipherStream::_mode [protected] |
Definition at line 56 of file CipherStream.h.
Referenced by overflow(), and sync().
1.7.1