summaryrefslogtreecommitdiff
path: root/src/encryption.h
diff options
context:
space:
mode:
author@syxhe <https://t.me/syxhe>2025-04-04 21:04:18 -0500
committer@syxhe <https://t.me/syxhe>2025-04-04 21:04:18 -0500
commite5454e63a086e549f54c23a686ff300b99a83b58 (patch)
tree3a39680d55e42bbc9449a52437f570f02fbfeb20 /src/encryption.h
parentcd307d16713f2552f8cf9c1116e860de3aa2cec6 (diff)
Make decryptto function also use named temporary files for writing
Diffstat (limited to 'src/encryption.h')
-rw-r--r--src/encryption.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/encryption.h b/src/encryption.h
index b5fe04e..b02216f 100644
--- a/src/encryption.h
+++ b/src/encryption.h
@@ -90,12 +90,22 @@ void vxgg_setsodiumfailcb(const vxgg_naclfailcb cb, void *data);
90// open() with the flags O_TMPFILE, O_WRONLY, O_CLOEXEC, and O_SYNC. Opened with mode S_IRUSR, S_IWUSR 90// open() with the flags O_TMPFILE, O_WRONLY, O_CLOEXEC, and O_SYNC. Opened with mode S_IRUSR, S_IWUSR
91int maketmp(const char * const dest); 91int maketmp(const char * const dest);
92 92
93int encrypttofile(FILE *dst, FILE *src, unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); 93// Encrypt src to dst using libsodium's xchacha encryption suite
94int decrypttofile(FILE *dst, FILE *src, unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); 94int encrypttofile(FILE *src, FILE *dst, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]);
95 95
96// Decrypt src to dst using libsodium's xchacha encryption suite
97int decrypttofile(FILE *src, FILE *dst, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]);
98
99// Encrypt file at `target` to `output` using Linux's named temp file system to do it in the background
96int encryptviatmp(const char * const target, const char * const output, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); 100int encryptviatmp(const char * const target, const char * const output, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]);
101
102// Decrypt the file at `encrypted` to `target`
97int decryptto(const char * const encrypted, const char * const target, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); 103int decryptto(const char * const encrypted, const char * const target, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]);
98 104
105//
106int linkto(const char * const target, int tgfd);
107
108//
99int genpassword(char **str, unsigned int words); 109int genpassword(char **str, unsigned int words);
100 110
101#endif \ No newline at end of file 111#endif \ No newline at end of file