Simple API key encryption/decryption utility.
More...
#include <KeyEncryption.hpp>
|
| static std::string | Encrypt (const std::string &plaintext) |
| | Encrypt an API key.
|
| |
| static std::string | Decrypt (const std::string &ciphertext) |
| | Decrypt an API key.
|
| |
| static bool | IsEncrypted (const std::string &value) |
| | Check if a string appears to be encrypted.
|
| |
Simple API key encryption/decryption utility.
Provides basic obfuscation for API keys stored in config files. Uses XOR cipher with device-specific key generation. Not military-grade encryption, but prevents casual reading of keys.
◆ Decrypt()
| std::string util::KeyEncryption::Decrypt |
( |
const std::string & |
ciphertext | ) |
|
|
static |
Decrypt an API key.
- Parameters
-
| ciphertext | Base64-encoded encrypted key |
- Returns
- Decrypted plain API key
◆ Encrypt()
| std::string util::KeyEncryption::Encrypt |
( |
const std::string & |
plaintext | ) |
|
|
static |
Encrypt an API key.
- Parameters
-
| plaintext | The plain API key |
- Returns
- Base64-encoded encrypted key
◆ IsEncrypted()
| bool util::KeyEncryption::IsEncrypted |
( |
const std::string & |
value | ) |
|
|
static |
Check if a string appears to be encrypted.
- Parameters
-
- Returns
- True if the string looks like an encrypted value
The documentation for this class was generated from the following files: