Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
XOREncryptionTool.hpp
Go to the documentation of this file.
1 #pragma once
2 #include "Tool.hpp"
3 #include <Algorithm/Algorithm.hpp> // Algorithm::Intent
4 #include <Core/Core.hpp>
5 #include <imgui.h>
6 
7 /*
8 * XOR Encryption/Decryption Tool Collapsing Header View To be drawn in ToolsScene
9 */
11 class XOREncryptionTool : public Tool {
12  public:
13  XOREncryptionTool() = default;
14  ~XOREncryptionTool() = default;
15 
16  public: /* Tool Life Cycle */
17  void OnCreate() override;
18  void OnDraw(Scene *parent) override;
19  void OnDestroy() override;
20 
21  public: /* Callbacks */
24 
25  public:
31  std::string XOREncrypt(const std::string& password, const std::string& buffer);
32 
38  std::string XORDecrypt(const std::string& password, const std::string& cipher);
39 
40  private:
41  Algorithm::Intent m_intent; // Are we Encryption or Decrypting?
42  std::string m_password{}; // XOR Key/Password
43  std::string m_input{}; // buffer/cipher to encrypt/decrypt with XOR
44  std::string m_output{}; // buffer/cipher to encrypt/decrypt with XOR
45 };
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Definition: Macros.hpp:13
#define NS_ENIGMA_END
Definition: Macros.hpp:14
Definition: Scene.hpp:20
Definition: Tool.hpp:10
void OnDestroy() override
void OnDraw(Scene *parent) override
void OnEncryptButtonPressed()
void OnDecryptButtonPressed()
std::string XORDecrypt(const std::string &password, const std::string &cipher)
~XOREncryptionTool()=default
void OnCreate() override
XOREncryptionTool()=default
std::string XOREncrypt(const std::string &password, const std::string &buffer)