// Copyright 2019-2024 The Hush developers // Released under the GPLv3 #ifndef FILEENCRYPTION_H #define FILEENCRYPTION_H #include #include #include #include #define FILEENCRYPTION_CHUNK_SIZE 4096 class FileEncryption { private: inline static bool exists (const std::string& name) { std::ifstream f(name.c_str()); return f.good(); } public: static void showConfig(); static int encrypt(QString target_file, QString source_file, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); static int decrypt(QString target_file, QString source_file, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); }; #endif