mirror of
https://github.com/kunkundi/crossdesk.git
synced 2025-10-27 04:35:34 +08:00
[feat] use AES to encrypt image names
This commit is contained in:
@@ -20,7 +20,8 @@ class Thumbnail {
|
||||
public:
|
||||
int SaveToThumbnail(const char* yuv420p, int width, int height,
|
||||
const std::string& host_name,
|
||||
const std::string& remote_id);
|
||||
const std::string& remote_id,
|
||||
const std::string& password);
|
||||
|
||||
int LoadThumbnail(SDL_Renderer* renderer,
|
||||
std::map<std::string, SDL_Texture*>& textures, int* width,
|
||||
@@ -32,12 +33,20 @@ class Thumbnail {
|
||||
std::vector<std::filesystem::path> FindThumbnailPath(
|
||||
const std::filesystem::path& directory);
|
||||
|
||||
std::string AES_encrypt(const std::string& key, const std::string& plaintext);
|
||||
|
||||
std::string AES_decrypt(const std::string& key,
|
||||
const std::string& ciphertext);
|
||||
|
||||
private:
|
||||
int thumbnail_width_ = 160;
|
||||
int thumbnail_height_ = 90;
|
||||
char* rgba_buffer_ = nullptr;
|
||||
std::string image_path_ = "thumbnails";
|
||||
std::string image_path_ = "thumbnails/";
|
||||
std::map<std::time_t, std::filesystem::path> thumbnails_sorted_by_write_time_;
|
||||
|
||||
std::string key_ = "1234567890123456";
|
||||
std::string iv_ = "1234567890123456";
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user