/*! * \brief * * \copyright 2023 Diality Inc. - All Rights Reserved. * * \file Obfuscate.h * * \author PBraica * \date March 2023 */ #ifndef OBFUSCATE_H_ #define OBFUSCATE_H_ #include /*! * \brief A way to obfuscate data to make it harder to detect patterns / read it. * * It increases size by 2 bytes. That header is a random chosen simplistic encryption * scheme. This can decode the whole thing at once or stream it in pieces. */ class Obfuscate { public: Obfuscate(); virtual ~Obfuscate(); std::string encode(const std::string& data); std::string decode(const std::string& data, bool is_start = true); std::string decode(const char * pData, std::size_t size_bytes, bool is_start = true); static std::size_t headerSize(); protected: unsigned char _secret; ///< Current encode secret. }; #endif // OBFUSCATE_H_