The code below shows the normal way to use the QCA::Cipher class.
#include <QtCrypto>
#include <cstdio>
#include <QCoreApplication>
#ifdef QT_STATICPLUGIN
#include "import_plugins.h"
#endif
int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
printf("AES128-CBC not supported!\n");
else {
key,
iv);
printf("Update failed\n");
}
printf("Final failed\n");
}
printf("Update failed\n");
}
printf("Decryption using AES128 of [0x%s] is %s\n",
plainText = cipher.
final();
printf("Final failed\n");
}
printf(
"Final decryption block using AES128 is %s\n", plainText.
data());
}
return 0;
}
MemoryRegion update(const MemoryRegion &a) override
pass in a byte array of data, which will be encrypted or decrypted (according to the Direction that w...
MemoryRegion final() override
complete the block of data, padding as required, and returning the completed block
QCA_EXPORT bool isSupported(const char *features, const QString &provider=QString())
Test if a capability (algorithm) is available.
void setup(Direction dir, const SymmetricKey &key, const InitializationVector &iv=InitializationVector())
Reset / reconfigure the Cipher.