encrypt filenames, keep filename when editing

This commit is contained in:
2025-11-03 16:55:38 +01:00
parent 871c76d018
commit d23faa1c6d
4 changed files with 70 additions and 58 deletions

View File

@@ -11,9 +11,10 @@ constexpr u64 AFTER_HEADER_OFFSET = 22;
struct FileHeader {
std::string name;
u64 size;
u64 name_ciphertext_size;
u64 content_size;
std::vector<u8> nonce;
u64 offset;
u64 global_offset;
};
class Vault {
@@ -26,10 +27,10 @@ public:
void delete_file(const std::string &name);
void update_file(const std::string &name, const std::string &content);
static std::optional<FileHeader> read_file_header(std::fstream &file);
private:
std::string m_path;
std::fstream m_file;
Botan::secure_vector<u8> m_key;
std::optional<FileHeader> read_file_header();
};