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
0
votes
1 answer

Read file as unsigned char* to encrypt with openssl in c++

As far as I can see the EVP funktions in openssl only accepts unsigned char * as input. An example code would be: int gcm_encrypt(unsigned char *plaintext, int plaintext_len, unsigned char *aad, int aad_len, unsigned…
root
  • 35
  • 5
0
votes
1 answer

Why is there a difference in generated cipher text between OpenSSL EVP C libraries and Python?

I'm seeing a difference in the cipher text generated ( and decryption fails as well but that's another story - I need the encrypted output to be correct/ as expected first). I ran the encryption using Python ( Pycryptodome) and saw different results…
umayneverknow
  • 190
  • 1
  • 3
  • 13
0
votes
1 answer

Creating ESP packet using C openssl AES-GCM encryption throws wrong ICV

I'm trying to encrypt my ICMP packet with AES128-CCM16. I used c openssl library for encryption. But encrypted result is wrong! I used two Linux 18.04 VM for simulating ESP packet with strongswan IPsec. I captured ESP packet and printed my whole…
Jaemin Jo
  • 45
  • 1
  • 8
0
votes
0 answers

SES SMTP mail giving openssl :EVP_CIPHER_CTX_set_key_length:invalid key length Error

We are creating Yii2 Rest API. We are implementing SES SMTP. Email is working fine but With API Response, We are getting 500 Internal Server Error with below Fetal Error: "Uncaught exception 'yii\base\ErrorException' with message 'fgets(): SSL…
Er. Anurag Jain
  • 1,780
  • 1
  • 11
  • 19
0
votes
0 answers

OpenSSL EVP_DecryptFinal_ex returns "wrong final block length" error when decrypting a file

I am using the EVP Symmetric Encryption and Decryption algorithm to encrypt and decrypt a file of text. The encryption works file, a new encrypted file is generated, but when I try to decrypt the file back it always crashes when EVP_DecryptFinal_ex…
Adrian
  • 19,440
  • 34
  • 112
  • 219
0
votes
1 answer

Testing a custom openSSL engine from the command line

Quick question: How can I verify the functionality of a custom openSSL engine I'm writing from the command line? Right now I am following along with this great tutorial, and am successfully able to exercise the engine (which returns a digest value…
asmvolatile
  • 522
  • 5
  • 22
0
votes
1 answer

implementing openssl evp encryption

I am currently doing some testing on brute forcing some simple text using EVP in C. The plaintext, ciphertext, key size, encryption method and methodology are provided. We simply need to try different key which is a known dictionary word. THE MAIN…
Hyperventilate
  • 145
  • 1
  • 2
  • 7
0
votes
0 answers

How to set and use Initialization Vector (IV) in OpenSSL EVP APIs

I am attempting to develop a file encryption function using user entered passphrase. I am studying the example functions at the WiKi here , but don't understand how 'key' and 'iv' exactly work. By experimenting I found out that I only need the same…
seedhom
  • 349
  • 2
  • 6
  • 19
0
votes
1 answer

C++ EVP_EncriptUpdate rewriting stack?

I have this code ..... const EVP_CIPHER * cipher = EVP_des_ecb(); uint8_t ot_byte,st_byte; EVP_CIPHER_CTX ctx; int trash; EVP_EncryptInit(&ctx,cipher, key, iv); cout << size - offset << endl; int i=0; for (; i < size - offset ;i++){ check =…
Charlestone
  • 1,248
  • 1
  • 13
  • 27
0
votes
0 answers

OpenSSL EVP Leaking Bytes

I'm using OpenSSL's EVP routine and can not eliminate all still reachable memory. The tutorial linked above leaks this much: ==30413== LEAK SUMMARY: ==30413== definitely lost: 0 bytes in 0 blocks ==30413== indirectly lost: 0 bytes in 0…
Chirality
  • 745
  • 8
  • 22
0
votes
1 answer

OpenSSL EVP_OpenFinal Fails, even though ciphertext is completely decrypted

I have an issue where the encryption process using EVP_SealInit, EVP_SealUpdate, and EVP_SealFinal are working and not returning any failure codes. Attempting to decipher the message works through EVP_OpenInit and EVP_OpenUpdate, however…
iterator
  • 53
  • 8
0
votes
1 answer

Segmentation fault in EVP_DecryptFinal_ex when using AES-128/CBC

This is a continuation of my previous question: Intermittent decryption failures in EVP_DecryptFinal_ex when using AES-128/CBC. I am trying to encrypt and decrypt using the C OpenSSL EVP library. After I received an answer to my question above, I…
Kingamere
  • 9,496
  • 23
  • 71
  • 110
0
votes
1 answer

OpenSSL EVP API Collision-Free vs. One-Way Property MAC

I'm working on an assignment where I have to compare a brute-force attack on a collision-free MAC vs. a one-way property MAC using the OpenSSL EVP library in C. Just to clarify, I'm not looking for any help on the assignment, just the…
Dexter
  • 1,128
  • 3
  • 25
  • 51
0
votes
1 answer

MD5 mismatch between openssl and linux bash calculation

I found this code online for calculating md5: #include #include #include #include #include unsigned char *getMd5Hash(unsigned char *data, size_t dataLen, int *mdLen) { unsigned char *md =…
ar2015
  • 5,558
  • 8
  • 53
  • 110
0
votes
1 answer

Invalid characters generated while encrypting with openssl evp aes_256_ctr() mode

My idea is to do file encryption in a client server model and i am using openssl evp for encryption purpose. I need to store the cipher text in a text file and send it to the client. But i am unable to do this because i find invalid characters being…
Sudershan
  • 425
  • 1
  • 4
  • 17