I am getting the following error when the function below runs on Qt Creator
/home/zero/build-EncryptionTask2-Desktop_Qt_5_7_0_GCC_64bit-Debug/EncryptionTask2 crashed.
I think it comes from converting to/from QByteArray
data type
QByteArray encryotionProgress(QByteArray d_input)
{
//QByteArray d_output;
params->key = key;
params->iv = iv;
/* Indicate that we want to encrypt */
params->encrypt = 1;
/* Set the cipher type you want for encryption-decryption */
params->cipher_type = EVP_aes_256_cbc();
/* Encrypt the given file */
unsigned char *enc_out;
AES_set_encrypt_key( params->key, 256, &enc_key);
AES_encrypt((unsigned char*)(d_input.data()), enc_out, &enc_key);
QByteArray d_output((char*)enc_out);//convert back to qbyte array
return d_output;
}