diff options
Diffstat (limited to 'src/encryption.h')
| -rw-r--r-- | src/encryption.h | 14 |
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 |
| 91 | int maketmp(const char * const dest); | 91 | int maketmp(const char * const dest); |
| 92 | 92 | ||
| 93 | int encrypttofile(FILE *dst, FILE *src, unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); | 93 | // Encrypt src to dst using libsodium's xchacha encryption suite |
| 94 | int decrypttofile(FILE *dst, FILE *src, unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); | 94 | int 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 | ||
| 97 | int 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 | ||
| 96 | int encryptviatmp(const char * const target, const char * const output, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); | 100 | int 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` | ||
| 97 | int decryptto(const char * const encrypted, const char * const target, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); | 103 | int decryptto(const char * const encrypted, const char * const target, const unsigned char key[crypto_secretstream_xchacha20poly1305_KEYBYTES]); |
| 98 | 104 | ||
| 105 | // | ||
| 106 | int linkto(const char * const target, int tgfd); | ||
| 107 | |||
| 108 | // | ||
| 99 | int genpassword(char **str, unsigned int words); | 109 | int genpassword(char **str, unsigned int words); |
| 100 | 110 | ||
| 101 | #endif \ No newline at end of file | 111 | #endif \ No newline at end of file |
