-
Notifications
You must be signed in to change notification settings - Fork 200
Open
Description
I tried to AES_256, AES_192, AES_128 encryption levels with ECB, CBC, CFB, OFB modes.
AES_128 is not working
AES_192 is not working
AES_256 working
The output is empty byte array.
`
QAESEncryption encryption(QAESEncryption::AES_128, QAESEncryption::CFB);
QString inputStr("The Advanced Encryption Standard (AES), also known by its original name Rijndael "
"is a specification for the encryption of electronic data established by the U.S. "
"National Institute of Standards and Technology (NIST) in 2001");
QString key("your-string-key");
QString iv("your-IV-vector");
QByteArray hashKey = QCryptographicHash::hash(key.toLocal8Bit(), QCryptographicHash::Sha256);
QByteArray hashIV = QCryptographicHash::hash(iv.toLocal8Bit(), QCryptographicHash::Md5);
QByteArray encodeText = encryption.encode(inputStr.toLocal8Bit(), hashKey, hashIV);
QByteArray decodeText = encryption.decode(encodeText, hashKey, hashIV);
QString decodedString = QString(encryption.removePadding(decodeText));
qDebug() <<"\n\nencodeText : " << encodeText << "\n\ndecodedString: " << decodedString;
`
What should I change in this code for properly working AES_128 and AES_192 ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels