TelegramTUI/inc/crypt.h

23 lines
397 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;
};