Мои функции шифрования/дешифрования:
Код: Выделить всё
int secure_crypto::rsa_decrypt(const std::vector &data, EVP_PKEY *privateKey,
std::vector &decrypted) {
try {
//create the context for verifying using unique_ptr
EVP_PKEY_CTX_free_ptr ctx(EVP_PKEY_CTX_new(privateKey, nullptr), ::EVP_PKEY_CTX_free);
if (ctx == nullptr) {
return -1;
}
//init the context for encryption
if (EVP_PKEY_decrypt_init(ctx.get())
Подробнее здесь: [url]https://stackoverflow.com/questions/79131421/openssl-3-3-1-rsa-decrypt-does-not-remove-padding[/url]
Мобильная версия