Hush lite wallet
https://faq.hush.is/sdl
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
763 B
26 lines
763 B
// Copyright 2019-2024 The Hush developers
|
|
// Released under the GPLv3
|
|
#ifndef FILEENCRYPTION_H
|
|
#define FILEENCRYPTION_H
|
|
#include <stdio.h>
|
|
#include <sodium.h>
|
|
#include <QString>
|
|
#include <fstream>
|
|
|
|
#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
|
|
|