[ad_1]
Finally I realized what was the problem it was in displaying the encrypted and decrypted strings when I tried result=QString::fromLocal8Bit((char*)ciphertext);
it worked fine and showed the original text.
[ad_2]
solved Wrong Encryption (QT c++ OpenSSL AES 256 CBC)