forked from lastpass/lastpass-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cipher.h
17 lines (14 loc) · 789 Bytes
/
cipher.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef CIPHER_H
#define CIPHER_H
#include "kdf.h"
#include "session.h"
char *cipher_rsa_decrypt(const unsigned char *ciphertext, size_t len, const struct private_key *private_key);
int cipher_rsa_encrypt(const char *plaintext,
const struct public_key *public_key,
unsigned char *out_crypttext, size_t *out_len);
char *cipher_aes_decrypt(const unsigned char *ciphertext, size_t len, const unsigned char key[KDF_HASH_LEN]);
char *cipher_aes_decrypt_base64(const char *ciphertext, const unsigned char key[KDF_HASH_LEN]);
size_t cipher_aes_encrypt(const char *plaintext, const unsigned char key[KDF_HASH_LEN], char **ciphertext);
char *cipher_base64(const char *bytes, size_t len);
char *encrypt_and_base64(const char *str, unsigned const char key[KDF_HASH_LEN]);
#endif