Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef XORSTREAM_H_
00009 #define XORSTREAM_H_
00010
00011 #include "ibrcommon/ssl/CipherStream.h"
00012 #include <string>
00013
00014 namespace ibrcommon
00015 {
00016 class XORStream : public CipherStream
00017 {
00018 public:
00019 XORStream(std::ostream &stream, const CipherMode mode, std::string key);
00020 virtual ~XORStream();
00021
00022 protected:
00023 virtual void encrypt(char *buf, const size_t size);
00024 virtual void decrypt(char *buf, const size_t size);
00025
00026 private:
00027 std::string _key;
00028 size_t _key_pos;
00029 };
00030 }
00031
00032 #endif