Skip to content

QAESEncryption Level is not working #63

@tlhcelik

Description

@tlhcelik

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions