Answer the question
In order to leave comments, you need to log in
C++, openssl how to make block encryption correct?
Good day,% habrauser%!
I am writing a simple fcgi application using openssl that will encrypt/decrypt incoming data. I don't know much about C++, so bicycle building is possible... Tell me how to properly encrypt / decrypt data in blocks? The code is here . In the previous version, it seemed to work, but crookedly due to the use of uninitialized variables. In the current one I'm trying to avoid this by block encryption, but it turns out nonsense of the form:
param_par: action=encrypt
param_par: text=my text for encrypt
substr size is 16
substr is my text for encr
substr encr is rH.gKf۵my text for encr
substr size is 3
substr is ypt
substr encr is :(ɬp9H,-ypt
final is rH.gKf۵my text for encr:(ɬp9H,-ypt:(ɬp9H,-ܫVD[g
Answer the question
In order to leave comments, you need to log in
//шифруем блок
if (1 != EVP_EncryptUpdate(ctx, out_buffer, &len, buffer, BUFF_SIZE))
handleErrors();
printf("substr encr is %s\n", (char *)out_buffer);
//запоминаем результат
e_param->result.append((char *) out_buffer);
index++;
e_param->data_len -= BUFF_SIZE;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question