Based on QCA::Cipher Example I managed to get an encrypted value.
String: hellohellohellohello
Encoded: d2fde01cb467a97de2e56bbd76fb0855
Key: cekpo
IV: cekpo
My code:
QString enc = "d2fde01cb467a97de2e56bbd76fb0855";
QCA::Initializer init;
QCA::SymmetricKey key(QByteArray("cekpo"));
QCA::InitializationVector iv(QByteArray("cekpo"));
QCA::Cipher cipher(QString("aes128"),
QCA::Cipher::CBC,
// use Default padding, which is equivalent to PKCS7 for CBC
QCA::Cipher::DefaultPadding,
// this object will encrypt
QCA::Decode,
key, iv);
QCA::SecureArray cipherText = QByteArray("d2fde01cb467a97de2e56bbd76fb0855");
printf("Decoded: %s\n", QCA::SecureArray(cipher.process(cipherText)).data() );
My question is, how can I decode it back to the original string ?