#ifndef BSPHP_CRYPTO_H
#define BSPHP_CRYPTO_H

#include <stddef.h>

int bsphp_md5_hex(const char *input, char out_hex[33]);
int bsphp_aes128_cbc_encrypt_base64(const char *plaintext, const char key16[17], char **out_b64);
int bsphp_aes128_cbc_decrypt_base64(const char *ciphertext_b64, const char key16[17], char **out_plain);
int bsphp_rsa_encrypt_pkcs1_base64(const char *message, const char *public_key_b64_or_pem, char **out_b64);
int bsphp_rsa_decrypt_pkcs1_base64(const char *cipher_b64, const char *private_key_b64_or_pem, char **out_plain);
char *bsphp_url_encode(const char *src);
char *bsphp_url_decode(const char *src);
const char *bsphp_crypto_last_error(void);
void bsphp_secure_free(char *ptr);

#endif
