24 lines
416 B
C++
24 lines
416 B
C++
#pragma once
|
|
|
|
#include <map>
|
|
#include <string>
|
|
|
|
class Crypt {
|
|
public:
|
|
Crypt();
|
|
|
|
void setKey(int64_t chatid, const std::string& keyfingerprint);
|
|
|
|
std::string encryptForChat(int64_t chat, const std::string& message);
|
|
|
|
std::string decryptFromChat(int64_t chat, const std::string& message);
|
|
|
|
void save();
|
|
void load();
|
|
|
|
private:
|
|
std::map<int64_t, std::string> chatKeyMap;
|
|
bool dirty = true;
|
|
std::string self;
|
|
};
|