Questions tagged [evp-cipher]

The EVP cipher routines are a high level interface to certain symmetric ciphers.

The EVP cipher routines are a high level interface to certain symmetric ciphers.

More details

59 questions
7
votes
1 answer

What is the ENGINE in OpenSSL and what is it used for?

I cannot find a good explanation of what the ENGINE in OpenSSL is. It is used in functions like EVP_PKEY_CTX_new. I am using EVP_PKEY_CTX_new just before I encrypt/decrypt something using EVP_PKEY_encrypt and EVP_PKEY_decrypt but do I really need to…
Blurry Sterk
  • 1,493
  • 9
  • 16
4
votes
1 answer

EVP Interface with AES-NI support

When using the OpenSSL crypto libraries in C/C++, does the EVP interface automatically support AES-NI hardware acceleration (assuming processor support)? Referring to this, it appears command-line OpenSSL does have support. I was wondering if there…
MVK_1
  • 63
  • 3
3
votes
1 answer

openssl EVP_CipherFinal_ex failed

I got this below function file_encrypt_decrypt for encryption and decryption of a file using AES256 CBC from here. If I'm doing encryption and decryption both from same program, (main function given at the end) encryption and decryption is working…
RatDon
  • 3,071
  • 6
  • 33
  • 73
3
votes
1 answer

Will ignoring to call openssl EVP_cleanup result in serious flaws or memory leaks?

I have an odd situation in my application. I am using the EVP methods in OpenSSL to compute digests and perform encryption. At the end of it, I am performing an EVP_cleanup() in the destructor of my CryptoProvider class (the main gateway to my…
SkypeMeSM
  • 2,876
  • 7
  • 40
  • 59
3
votes
1 answer

How to set zero padding to EVP_CIPHER?

Is possible to set Zero Padding when using EVP_CIPHER. I know that the default padding for EVP_EncryptInit_ex is enabled and it uses PKCS padding. And with EVP_CIPHER_CTX_set_padding you can only enable and disable the padding.
Alex Terente
  • 11,770
  • 5
  • 47
  • 66
3
votes
0 answers

OpenSSL EVP and CryptoJS

CryptoJS is said to be OpenSSL compatible what can be noticed running the demo. Now I want to implement the same behavior using the OpenSSL EVP API: chipher a string using a passphrase and exchange the result with CryptoJS which must be able to…
PauloASilva
  • 900
  • 1
  • 6
  • 19
3
votes
1 answer

EVP_CIPHER* to name

I've got an EVP_CIPHER* by using EVP_get_cipherbyname("AES-256-CTR"), now I would like to find a way to get from the EVP_CIPHER* back to the original name, in this case "AES-256-CTR". Is there a method to do this in libcrypto?
X-Istence
  • 15,338
  • 6
  • 52
  • 73
2
votes
1 answer

C AES-GCM Decryption of ESP packet not working

I'm trying to decrypt my ESP packet encrypted with AES128-GCM12. I used c openssl library for decryption. But decrypted result is wrong! I used two Linux 18.04 VM for simulating ESP packet with strongswan IPsec. I captured ESP packet and printed my…
Jaemin Jo
  • 45
  • 1
  • 7
2
votes
0 answers

How to properly define EVP_CIPHER init/update/final functions in a custom ENGINE?

I'm building a dynamic engine to support a custom AES hardware module that I've implemented in FPGA logic**, but after reading all available documentation, and pouring over the source code, I'm still very confused about the following two…
Brett
  • 512
  • 2
  • 20
2
votes
1 answer

After decrypting EVP cipher with OpenSSL, 8 bytes of plaintext are always incorrect

I'm having trouble decrypting some data with the OpenSSL library, using the EVP functions and a symmetric key. I encrypt the data on the command like using openssl enc, then decrypt with come C++ code. This works ... mostly. No matter what data I…
Steve
  • 6,085
  • 2
  • 35
  • 62
2
votes
1 answer

using EVP_aes_128_gcm in openssl for aad with size of not multiple of 16

I am trying to use openssl EVP (EVP_aes_128_gcm) as interface for GMAC. I am testing the code against the NIST's CAVP GCM test vector (http://csrc.nist.gov/groups/STM/cavp/documents/mac/gcmtestvectors.zip). The problem is: when the aad size is…
Tom
  • 211
  • 2
  • 9
2
votes
1 answer

Proper way to encrypt a file with openssl using the EVP api in C

What I am trying to do: Encrypt an executable, then decrypt it later. What my problem is: looping properly through the exe. Here is what my code currently looks like: unsigned char ckey[] = "thiskeyisverybad"; unsigned char ivec[] =…
Kevin
  • 2,481
  • 4
  • 27
  • 63
2
votes
0 answers

HsOpenSSL cipher result different from M2Crypto and command line?

I'm writing a program to interface with another program written in python. I find that the ciphered results are different. In ghci, with HsOpenSSL, the ciphered result is \GS\n\197: import OpenSSL import OpenSSL.EVP.Cipher import Data.Maybe method…
rnons
  • 313
  • 2
  • 9
1
vote
1 answer

How to encrypt/decrypt using key index in OpenSSL EVP APIs?

My system includes a Hardware Secure module(HSM), which imports symmetric/asymmetric keys to its internal memory, then provides key index to outside users for future use(encrypt/decrypt). I'm now writing an OpenSSL engine for this HSM, which is…
yoyozi
  • 33
  • 4
1
vote
1 answer

How to decrypt using openssl EVP?

I'm trying to decrypt a file using C (but I can change to C++), but I don't know how to use the EVP library correctly. The console command that I want to replicate is: openssl enc -rc2-ecb -d -in myfile.bin -iter 1 -md sha1 -pbkdf2 -pass…
1
2 3 4