FBB::ISymCryptStream(3bobcat) | Symmetric en- and decryption | FBB::ISymCryptStream(3bobcat) |
FBB::ISymCryptStream - Istream performing symmetric encryption
#include <bobcat/isymcryptstream>
Linking option: -lbobcat -lcrypto
FBB::ISymCryptStream objects may be used to encrypt or decrypt information that is available on a separate std::istream.
The class ISymCryptStream is a class template, using a FBB::CryptType template non-type parameter. Objects of the class FBB::ISymCryptStream<FBB::ENCRYPT> encrypt the information they receive, objects of the class FBB::ISymCryptStream<FBB::DECRYPT> decrypt the information they receive.
All symmetric encryption methods defined by the OpenSSL library that can be selected by name may be used in combination with EncryptBuf objects. To select a particular encryption method an identifier is passed to the constructor. E.g., "aes-128-cbc" indicating the AES (Rijndael) method, using 128 bit sized keys and blocks using `cbc’ mode (see below for an explanation).
Refer to the isymcryptstreambuf(3bobcat) man-page for a description of available encryption methods.
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
FBB::ISymCryptStreambuf (private),
std::istream
Copy and move constructors (and assignment operators) are not available.
Since the class uses public derivation from std::istream, all members of this class can be used.
#include "../isymcryptstream" #include <iostream> using namespace std; using namespace FBB; int main() {
ISymCryptStream<ENCRYPT> encryptor(cin, "bf-cbc",
"1234567890", "1234567890");
ISymCryptStream<DECRYPT> decryptor(encryptor, "bf-cbc",
"1234567890", "1234567890");
cout << decryptor.rdbuf(); }
bobcat/isymcryptstream - defines the class interface
Sep/Oct 2013: due to a change in library handling by the linker (cf. http://fedoraproject.org/wiki/UnderstandingDSOLinkChange and https://wiki.debian.org/ToolChain/DSOLinking) libraries that are indirectly required are no longer automatically linked to your program. With BigInt this is libcrypto, which requires programs to link to both bobcat and crypto.
Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.
This is free software, distributed under the terms of the GNU General Public License (GPL).
Frank B. Brokken (f.b.brokken@rug.nl).
2005-2020 | libbobcat-dev_5.07.00 |