Answer the question
In order to leave comments, you need to log in
C++, openssl, fcgi what's wrong with the decrypt function?
Good day,% habrauser% Tell me
, why does it show the correct phrase in the console when decrypting previously encrypted text, and a lot of rubbish comes into the stream? Example,
Lib is inited
Socket is opened
Request is inited
Try to accept new request
request is accepted
param_par: action=encrypt
param_par: text=my text for encrypt
Encr text is: [email protected]]P֦Ǒf
data len: 19
chph_len: 32
hash_len: 45
Hash text is: TS52kR7EQPq0HlaUcjW2QV2051DA1qb0x5ERmpyY/2b/
Try to accept new request
request is accepted
param_par: action=decrypt
param_par: text=TS52kR7EQPq0HlaUcjW2QV2051DA1qb0x5ERmpyY/2b/
hash_len len: 44
chph len: 33
chph is: [email protected]]P֦Ǒf
result_len: 64
inal: my text for encrypt
string(235) "HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Thu, 29 May 2014 06:54:40 GMT
Server: Apache/2.4.9 (Win32) PHP/5.5.11
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
TS52kR7EQPq0HlaUcjW2QV2051DA1qb0x5ERmpyY/2b/
"
string(223) "HTTP/1.1 100 Continue
HTTP/1.1 200 OK
Date: Thu, 29 May 2014 06:54:43 GMT
Server: Apache/2.4.9 (Win32) PHP/5.5.11
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8
my text for encrypt
я"
2147144708:error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length:evp_enc.c:532:
Answer the question
In order to leave comments, you need to log in
Problem solved. It was necessary to simply reduce the size of the text decoded in 64 by 1 (as I understand it, 0 bytes)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question