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

69 questions
11
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,595
  • 2
  • 9
  • 18
5
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…
MadhuVK
  • 73
  • 1
  • 4
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,403
  • 8
  • 43
  • 85
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
  • 3,197
  • 8
  • 43
  • 61
3
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
  • 321
  • 2
  • 9
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
  • 12,006
  • 5
  • 51
  • 71
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
  • 1,000
  • 1
  • 7
  • 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
  • 16,324
  • 6
  • 57
  • 74
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
  • 8
2
votes
1 answer

How to solve this 'EVP_DecryptFinal_ex:wrong final block length' error?

I would like to encrypt the architecture of a neural network, so I could protect the knowledge property of my research. An example of one of these files, have similar structure as this example. The code compiles, but I get a runtime error that I…
Carlos Ost
  • 492
  • 7
  • 22
2
votes
1 answer

What is the difference between Sign, DigestSign, and Digest?

I'm implementing hashing (aka. digest) and signing in an app that uses the OpenSSL EVP API. However the API has three very similar methods, which are confusing: Sign which sounds like it should be used for signing, however EVP_SignInit is simply a…
Venemo
  • 18,515
  • 13
  • 84
  • 125
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…
asmvolatile
  • 522
  • 5
  • 22
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,334
  • 4
  • 39
  • 67
2
votes
1 answer

OpenSSL EVP API: How to decrypt the encrypted file using a symmetric key file

Hi I'm working on C on Linux. I have a query related to symmetric key decryption. I have generated an symmetric key using the below command. openssl rand base64 512 > sym.key Using this key (sym.key) I have encrypted a file with below…
Sai
  • 931
  • 1
  • 7
  • 6
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
  • 3,077
  • 6
  • 31
  • 77
1
2 3 4 5