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
1
vote
1 answer

Working with EVP and OpenSSL, coding in C

I've seen many questions on OpenSSL and EVP, but not very many clear answers, but I figured I'd still post my question here and hope for better feedback. The materials given to me are a signed file "symmetrickey.bin", an RSA key set…
1
vote
1 answer

Segmentation fault in EVP_CIPHER_CTX_new() when using OpenSSL in C

I am a total beginner with the OpenSSL Library in C but was working on a code to encrypt using the libraries while taking a pass phrase as input and generating the salt,IV and key from the pass phrase. This is what I have tried till now: int…
Ashwin_Mathew
  • 50
  • 1
  • 8
1
vote
1 answer

Does Digest Init-Update-Final mechanism make a copy of input data?

I compute a hash using init-update-final mechanism i.e. initialize the hash context, followed by hash update with various sizes of input data, and a final digest calculation. This can be done using the EVP_DigestInit, EVP_DigestUpdate and…
SkypeMeSM
  • 3,197
  • 8
  • 43
  • 61
1
vote
1 answer

Undefined reference to EVP_idea_ecb on Debian

I have the following code: #include #include #include int main (int argc, char *argv[]) { EVP_CIPHER *cipher; EVP_idea_ecb(); } I know, this is not much, but it should compile without complaints, but I…
user3417078
  • 265
  • 4
  • 15
1
vote
1 answer

Encryption using AES_* functions and EVP_* functions

I have some data that was encrypted using the openssl (AES_*) functions. I want update this code to use the newer (EVP_*) functions. But should be able to decrypt data that was encrypted using the old code. I've pasted below both the old and the…
Code Robot
  • 51
  • 6
1
vote
1 answer

OpenSSL EVP_CIPHER free/release

I can't find any method like EVP_CIPHER_free in openssl/evp.h. Don't I need to release the EVP_CIPHERs?
miho
  • 11,765
  • 7
  • 42
  • 85
0
votes
0 answers

Disabling padding in OpenSSL version 3

im trying to write a program that disable padding when it encrypts a message in C language. I figured out, by reading the documentation, that the correct function to use is EVP_CIPHER_CTX_set_padding(). I used it but the program still doesn't work.…
FilResto
  • 1
  • 3
0
votes
1 answer

Decryption failure using openssl EVP_CipherFinal_ex

I am trying to encrypt and decrypt a buffer using openssl. I took some example code from here (see the 2nd do_crypt function towards the end of the page) and modified it to take the message to encrypt/decrypt from a vector instead of an input…
Simpsons
  • 476
  • 1
  • 7
  • 17
0
votes
1 answer

awscrt python module throwing 'undefined symbol: EVP_aead_aes_128_gcm_tls13' error in ARM yocto

I have a custom ARM gateway on which I am trying to run a greengrass v2 component. This requires python awsiotsdk. But when I import the awsiotsdk I am getting this error: ImportError:…
Kiran G
  • 67
  • 1
  • 2
  • 8
0
votes
3 answers

OpenSSL EVP AES Encryption and Base64 Encoding producing unusable results

So I'm trying to reproduce an encryption and encoding operation in C, that I've managed to make work in C#, JScript, Python and Java. Now, it's mostly just for obfuscating data - not actual encryption - so it's basically for aesthetic purposes…
krzychostal
  • 53
  • 1
  • 6
0
votes
0 answers

EVP_DecryptUpdate() returns 0

For some reason, I am getting 0 from EVP_DecryptUpdate() function when I am passing 32 as its last parameter but when I changed it to 64 it returns 1. The buffer size is 32. According to the documentation, I should get a 1 if the decrypt is…
Kivuos
  • 13
  • 4
0
votes
0 answers

OpenSSL encryption/decryption command line in C++

can you tell me what the C++ equivalent is for the command line OpenSSL commands for encrypting a file: openssl enc -nosalt -aes-256-cbc -kfile c:\temp\key -in c:\temp\binary.png -out c:\temp\binary.enc and decrypting that file back again : openssl…
xyfix
  • 61
  • 1
  • 7
0
votes
1 answer

Is there any way to set members of opaque structs in openssl v1.1.0 or greater?

I am restructuring a legacy code to be compatiable with OpenSSL 1.1.1, During the upgrade of OpenSSL from 1.0.2 -> 1.1.1, serveral structs were made opaque and direct member access is no longer possible. I have a requirement to set buf_len of…
Kethiri Sundar
  • 480
  • 2
  • 12
0
votes
1 answer

C Encryption logic not matching with java

I am looking for equivalent C code for below java code. i am trying to write two application one in java and other in C. Java application encrypt/decrypt "string" with below logic, and it is working when using below java method. public class…
Aby
  • 25
  • 1
  • 9
0
votes
0 answers

HMAC verification goes wrong with Openssl EVP

The code i wrote somehow does not work properly. When using the same key and cipher with an online tool, the hmac is different. My code is: EVP_MD_CTX* mdctx = NULL; const EVP_MD* md = NULL; EVP_PKEY *pkey = NULL; unsigned char…
root
  • 35
  • 5