Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
EncryptTextScene.hpp
Go to the documentation of this file.
1 #pragma once
2 #include "Scene.hpp"
3 #include <Algorithm/AES/AES.hpp>
4 
6 class EncryptTextScene : public Enigma::Scene {
7  public: /* Constructors / Destructor */
9  ~EncryptTextScene() noexcept override = default;
10 
11  private: /* Overrides */
12  void OnCreate() override;
13  [[maybe_unused]] void OnUpdate(const float& dt) override;
14  void OnDraw() override;
15  void OnImGuiDraw() override;
16  void OnEvent(Enigma::Event& event) override;
17  void OnDestroy() override;
18 
19  private: /* Callbacks */
20  void OnEncryptButtonPressed();
21  void OnCopyEncryptedBase64TextButtonPressed();
22  void OnBackButtonPressed();
23 
24  private:
25  Algorithm::Type m_type; // Algorithm type, AES, ChaCha, TripleDES... to help us create polymorphic algorithm
26  std::string m_text; // Text to encrypt
27  std::vector<byte> m_cipher; // Encrypted text
28  std::string m_cipher_base64; // Encrypted text in Base64
29  std::string m_password, m_confirm_password; // Encryption password
30 
31  // Save to database
32  std::string m_db_title;
33  bool m_save_to_database{false};
34 
35  // Rsa special stuff
36  std::string m_rsa_private_key;
37  std::string m_rsa_public_key;
38  std::size_t m_selected_rsa_keySize = 4096;
39 };
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Definition: Macros.hpp:13
#define NS_ENIGMA_END
Definition: Macros.hpp:14
Algorithm abstract class.
Definition: Algorithm.hpp:53
~EncryptTextScene() noexcept override=default
Definition: Event.hpp:66