Comments (3)
I'll look into it
from qt-aes.
Hi, it's possible one of the recently merged changes broke the code, can you try with an older commit?
Can you post a code sample that fails?
from qt-aes.
I want to thank you for your fast response.
I tried following code with AES_256 and this is working perfect. But when I change encryption level there is no any output.
I built the QtAES.lib from master branch.
`
void MainWindow::AES_TEST()
{
//TEST
QAESEncryption encryption(QAESEncryption::AES_256, QAESEncryption::CBC);
QString inputStr("Ataturk dealt with the translation of scientific terminology into Turkish."
"He wanted the Turkish language reform to be methodologically based."
"Any attempt to cleansethe Turkish language of foreign influence without"
"modelling the integral structure of the language was inherently wrong to him");
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;
//TEST
}
`
The output with AES_256:
encodeText : "v\x1AzA\xD3\x96\xBA\xB2G\x89s\xE8\xF8\x07""6\xFA\x1F\x15[\x02\rpf\x86{>$\r*\x9D\xC1""1z\xE0\xF0\x13\xCC_A\xFD\x86W\xE4""7kpr\x11\x1C\x05Q\xD1\xA8\xE0;\xC1}|\x9F+)\x82""C\x06\x16:\xF9\x1B\xA7\xE2\xD2\xEB\xEE\xB9\x0E\x9E\x0B""A\x0B\xE6\xD1""E_JQ\b\xA3\x19\x8D\x8F\x03\xC8\xFD\xD9@\xEC\xEA\xC6\x07N\xADZ9\x12\xF3\x9Em\xFE\xD5\xB9\xB2\x83\x94\x91\x02R\x03\xEBW\x99""f\xA5\xCE\xB4\xF8tF1RU\xB9\x0F\xED""E\xB3z\xB2K\xB1P\xCE\xBE""d\xF6\x8F\x07\xFC]\xD3\x80\xB9\xBE@\x9F""1G\n\x93""9JO\xBF\xDF\x89\xC6Kh!\x1D\xEE""Eh\x10$%~\xC2\xE4""1\brB\xD6\x82j\xF8\n\xA3\xA3J_\x8Dl\x04W\xC8Z\x14\x0E\x19R|^\xB4M-\x91:\xC9\xD9\x10\xB8\x97""8P\xBD""A|\x95\xFE\xB2\x15\rm+\xC0""8<\xE3]z\xB1""3\x12\xD1j\xDB\x06\xA2\xD8=\x90gy\xDAy\xCA\xDD'\xFA\xD3\xCFy\x06!!\xC2\xDEj\x00\xE4\xA3|-s\xE1\r\x9Fn\xA1\x8B!\x18u\x9C\xD5\x15\xC4\x8D\xC6j\xF4\xCAYM\x19"
decodedString: "Ataturk dealt with the translation of scientific terminology into Turkish.He wanted the Turkish language reform to be methodologically based.Any attempt to cleansethe Turkish language of foreign influence withoutmodelling the integral structure of the language was inherently wrong to him"
The following code giving not any output:
`
void MainWindow::AES_TEST()
{
//TEST
QAESEncryption encryption(QAESEncryption::AES_128, QAESEncryption::CBC);
QString inputStr("Ataturk dealt with the translation of scientific terminology into Turkish."
"He wanted the Turkish language reform to be methodologically based."
"Any attempt to cleansethe Turkish language of foreign influence without"
"modelling the integral structure of the language was inherently wrong to him");
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;
//TEST
}
`
The output with AES_128:
encodeText : ""
decodedString: ""
from qt-aes.
Related Issues (20)
- Can't run in 32bit Qt HOT 5
- Suggestion: Function to check validity of encoded data OR make the decode() method not crash app on invalid data HOT 12
- compatibility with openssl issue HOT 4
- use HOT 2
- It will crash in MinGW32 HOT 1
- Supporting GCM HOT 1
- Regarding the problem that the padding is not removed after decryption HOT 2
- Support protocol buffers (protobuf) HOT 1
- AES implementation is really slow for big data HOT 1
- Decrpytion with AES-NI not working HOT 5
- AES CFB Without padding HOT 3
- Convert QByteArray to QString HOT 1
- App broken with msvc compiler in last version HOT 3
- suggest to add more check to decode() method paremeters
- <Suggestion: Expand beyond Qt-AES> HOT 2
- AES-NI вопрос? AES-NI question? HOT 1
- Question about qt-secret usage. HOT 2
- Adding Salt ?
- Question about : Heap corruption detected: after normal block..... HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qt-aes.