Code Monkey home page Code Monkey logo

qt-aes's Introduction

Qt-AES

Small and portable AES encryption class for Qt. Native support for all key sizes - 128/192/256 bits - ECB, CBC, CFB and OFB modes for all key sizes partial AES-NI support

Usage

Available Methods

// Encode of rawText with key
// iv is used in CBC mode
// return the encrypted byte array
QByteArray encode(const QByteArray rawText, const QByteArray key, const QByteArray iv = QByteArray());

// Decode of rawText with key
// iv is used in CBC mode
// return the decrypted byte array
QByteArray decode(const QByteArray rawText, const QByteArray key, const QByteArray iv = QByteArray());

// Key expansion in Rijndael schedule
// return the new expanded key as byte array
QByteArray expandKey(const QByteArray key);

The same methods are available as static calls

QAESEncryption::Crypt => encode(...)
QAESEncryption::Decrypt => decode(...)
QAESEncryption::ExpandKey => expandKey(...)

AES Levels

The class supports all AES key lenghts

  • AES_128
  • AES_192
  • AES_256

Modes

The class supports the following operating modes

  • ECB
  • CBC
  • CFB
  • OFB

Padding

By default the padding method is ISO, however, the class supports:

  • ZERO
  • PKCS7
  • ISO

Example

Sample code using a 128bit key in ECB mode

#include "qaesencryption.h"

QAESEncryption encryption(QAESEncryption::AES_128, QAESEncryption::ECB);
QByteArray encodedText = encryption.encode(plainText, key);

QByteArray decodedText = encryption.decode(encodedText, key);

Example for 256bit CBC using QString

#include <QCryptographicHash>
#include "qaesencryption.h"

QAESEncryption encryption(QAESEncryption::AES_256, QAESEncryption::CBC);

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));

//decodedString == inputStr !!

Example via static invocation

Static invocation without creating instances, 256 bit key, ECB mode, starting from QString text/key

#include <QCryptographicHash>
#include "qaesencryption.h"

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);

//Static invocation
QByteArray encrypted = QAESEncryption::Crypt(QAESEncryption::AES_256, QAESEncryption::CBC, 
                        inputStr.toLocal8Bit(), hashKey, hashIV);
//...
// Removal of Padding via Static function
QString decodedString = QString(QAESEncryption::RemovePadding(decodeText));

AES New Instructions Set

To use the hardware acceleration provided by the AES New Instructions Set, define USE_INTEL_AES_IF_AVAILABLE If the CPU supports it, the code will switch to use AESNI automatically. The feature is enabled by default

Unit Testing

The unit testing vectors used are included in NIST-Recommendation for Block Cipher Modes of Operation

Please note that this code is not audited or AES-certified by any competent authority, use it at your own risk.

Dependencies

  • qtcore

No OpenSSL required.

Contact

Question or suggestions are welcome! Please use the GitHub issue tracking to report suggestions or issues.

License

This software is provided under the UNLICENSE

Known Issues

Please take a look at the list of currently open issues

qt-aes's People

Contributors

andibacher avatar beardedbeaver avatar bricke avatar evilyach avatar fetzerch avatar hamedmasafi avatar mikedld avatar oleg-derevenetz avatar ph-valiu avatar ssakone avatar tomgey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qt-aes's Issues

Heap corruption

QByteArray decrypted_file_buffer_1 = QAESEncryption::Decrypt(QAESEncryption::AES_256, QAESEncryption::CBC, encrypted_file_buffer_1, hash_key, hash_iv);

QByteArray decrypted_file_buffer_2 = QAESEncryption::Decrypt(QAESEncryption::AES_256, QAESEncryption::CBC, encrypted_file_buffer_2, hash_key, hash_iv);

Calling like this for multiple file buffers results in random heap corruption.
It doesn't happen while using openssl.

Cannot build with Qt 5.6

Your use of QByteArray::insert(int, int, char) was added in 5.7, meaning builds with 5.6 break.

Perhaps you could add some ifdefs around the code and another method for performing the same operation?

AES-NI вопрос? AES-NI question?

Реализована ли у вас возможность использовать библиотеку, так чтобы она автоматически выбирала подходящий метод в зависимости от возможностей процессора?
Do you have the ability to use a library so that it automatically selects the appropriate method depending on the processor's capabilities?

AES implementation is really slow for big data

When I try to encrypt data in the size of 1-2 GB it takes about 10 min to encrypt it with a 256 bit key in CBC mode with an 128 bit IV (Running Windows 10, i7-7700HQ, 24GB RAM).
Anything I could do to increase the speed?

Code snippet:

bigFileData.size() <== 1.9GB
key <== created with SHA256
iv <== created with Blake2s-128

QByteArray encodedText = aes.encode(bigFileData, key, iv);

Qt-AES 256 CFB decode message from Java

I have an issue, I'm developing an android app that comunicate with a Qt develop application through an UDP socket.

Just to study, I tried to encrypt comunication using AES CFB NoPadding:

Java side:

public final String key = "123456789123";
public final byte initVector[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05,             0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
byte [] hashKey = null;
Cipher m_encChiper;
Cipher m_decChiper;


//Init 
MessageDigest digest = MessageDigest.getInstance("SHA-256");
hashKey = digest.digest(msgTools.key.getBytes("UTF-8"));

IvParameterSpec iv = new IvParameterSpec(msgTools.initVector);
SecretKeySpec skeySpec = new SecretKeySpec(hashKey, "AES");

m_encChiper = Cipher.getInstance("AES/CFB/NoPadding");
m_encChiper.init(Cipher.ENCRYPT_MODE, skeySpec, iv);

m_decChiper = Cipher.getInstance("AES/CFB/NoPadding");
m_decChiper.init(Cipher.DECRYPT_MODE, skeySpec, iv);

//Enc and Dec function

   public byte[] encrypt(String value) {
        try {

            byte[] encrypted = m_encChiper.doFinal(value.getBytes());
            return encrypted;
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }

    public String decrypt(byte [] encrypted) {
        try {

            byte[] original = m_decChiper.doFinal(encrypted);

            return new String(original);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }

Qt Side:

QAESEncryption *encryption = NULL;
QString key = "123456789123";
QByteArray hashKey = QCryptographicHash::hash(key.toLocal8Bit(),             QCryptographicHash::Sha256);
QByteArray iv;

encryption = new QAESEncryption(QAESEncryption::AES_256,     QAESEncryption::CFB);
quint8 iv_16[16]     = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
    for (int i=0; i<16; i++)
        iv.append(iv_16[i]);


QByteArray SenderThread::encryptData(QString msg)
{
    return encryption->encode(msg.toLocal8Bit(), hashKey, iv);
}

QString SenderThread::decodeData(QByteArray xMsg)
{
    return QString(encryption->decode(xMsg, hashKey, iv));
}

The problem is that, sending a string that encoded in java result in a 17 byte buffer, will be decoded in Qt correctly for the first 16 byte than QAESEncryption::decode at:

...
case CFB:
            if (i+m_blocklen < rawText.size()){
                ret.append(byteXor(rawText.mid(i+m_blocklen, m_blocklen),
                                   cipher(expandedKey, rawText.mid(i, m_blocklen))));
...

with i = 0 m_blocklen = 16, append other 16 bytes, the first is the correct 17th others 15 are non sense...

The same sended string has been encoded locally in Qt resulting in a 32 byte buffer that are corretly decoded.
The same sended string has been encoded locally in Java resulting in a 17 byte buffer that are corretly decoded.

any idea on what's wrong when I pass from a platform to another??

Thanks a lot for all

PKCS5 Padding

hi ,
can you add PKCS#5 padding to this project ?

Windows issue Release vs Debug

Lovely library and been working without issues for osx. However, trying to use with windows and having issues. Debug works fine and the same output is generated (as on osx)

However Release comes out with something wrong. I don't have a windows box in front of me so did a remote debugging session over skype which is a fairly slow process and found that the issue begins after calling expandKey

https://github.com/bricke/Qt-AES/blob/master/qaesencryption.cpp#L397

The expanded key is different.

Please note there are also some warnings, for type mismatch in windows for example:
ret.lastIndexOf(0x80)

This could maybe be a clue to some of the issues.

AES CFB Without padding

Hi
In AES-CFB is there anyway to encode data without padding in the Qt-AES library?

I used QAESEncryption::ZERO and QAESEncryption::ISO but it still changes the encrypted data length
Thanks

can't build on windows by vs2013

error C2536: “QAESEncryption::QAESEncryption::sbox”: 无法指定数组的显式初始值设定项
c:\qt\gitcode\qt-aes\debug../qaesencryption.h(83) : 参见“QAESEncryption::sbox”的声明
It's meaning cann't init this sbox array

Convert QByteArray to QString

I use AES_128 for encoding. After encoding, I want to store the ciphertext to the Sqlite DB. To tackle this, I need to convert the qbytearray to qstring. I tried all possible way on the web but the output of the convertors are not the same as the qbytearray.
Is there any other option for me? Foe example is other encoding better than AES_128 for my purpose? Or other option for converting to QString?

Suggestion: Function to check validity of encoded data OR make the decode() method not crash app on invalid data

I'm currently at a point that requires me to decode an encrypted QByteArray but in my case it is possible for the passed data to be invalid.
If I now pass this invalid data through the decode() method the entire app crashes, giving me the following error:

HEAP[MyApp.exe]: Heap block at 000001DA7A1C7B10 modified at 000001DA7A1C7B70 past requested size of 50
HEAP[MyApp.exe]: Invalid address specified to RtlValidateHeap( 000001DA706F0000, 000001DA7A1C7B20 )
Debug Assertion Failed!

Program: ...sktop_Qt_5_12_8_MSVC2017_64bit-Debug\debug\MyApp.exe
File: minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp
Line: 904

Expression: _CrtIsValidHeapPointer(block)

Using a try {} catch {} doesn't work, since the error seems to corrupt the heap in some way.
I know I should fix the source of the problem rather than trying to fix the symptoms but I don't see a bulletproof way to do this in my case.

  • My suggestion is to add a function / method that checks the validity of a passed (encoded) QByteArray, which can either directly be implemented in the decode() method or run by the user themselves prior to decoding if needed.
  • An alternative solution is to make the decode() method just throw a catch-able Error when the passed data is invalid.

Technical Details:

  • Qt v5.14.2
  • Qt-AES v1.1
  • OS: Windows 10 (1909)
  • Compiler: MSVC 2017 64bit

Question about qt-secret usage.

Hi,
I am main developer of Ruqola (KDE Rocket chat client).
I want to implement encryption.
you can see how it works "https://docs.rocket.chat/customer-center/security-center/end-to-end-encryption-specifications"

Mainly we need to generate key:
"crypto.subtle.generateKey({name: 'RSA-OAEP', modulusLength: 2048,
publicExponent: new Uint8Array([0x01, 0x00, 0x01]), hash: {name: 'SHA-256'}},
true, ['encrypt', 'decrypt']);"

and
RocketChat.E2E.crypto.generateKey({name: 'AES-CBC', length: 128}, true,
['encrypt', 'decrypt'])

Do you think that your lib can be use in my case ?

Thanks
Regards

It will crash in MinGW32

Error - RtlWerpReportException failed with status code :-1073741823. Will try to launch the process directly

May be a problem with QAESEncryption encryption (QAESEncryption::AES_256, QAESEncryption::CBC);

Hi,
Thank you for your job.

I would like to use QAESEncryption object to encrypt and decrypt some tokens generated by the Google API (https://github.com/ptstream/QtUPnP).

To test your code I try a simple program.

#include <QCoreApplication>
#include "qaesencryption.h"
#include <QCryptographicHash>
#include <QDebug>`

int main(int argc, char *argv[])
{
  QCoreApplication a(argc, argv);
  QAESEncryption encryption (QAESEncryption::AES_256, QAESEncryption::CBC);
  QByteArray input("uuid:e18d497c-e09b-4154-af73-ed7e69d142e8:uuid:2a684c04-66f5-448b-b905-f162334ea75d");
  QByteArray key("your-string-key");
  QByteArray iv ("your-IV-vector");

  QByteArray hashKey = QCryptographicHash::hash(key, QCryptographicHash::Sha256);
  QByteArray hashIV = QCryptographicHash::hash(iv, QCryptographicHash::Sha256);

  QByteArray encodeText = encryption.encode(input, hashKey, hashIV);
  qDebug () << encodeText;

  QByteArray decodeText = encryption.decode(encodeText, hashKey, hashIV);
  qDebug () << decodeText;
  qDebug () << input;

  return 0;
}

The function encode return always an empty QByteArray.
This is due to the first test where m_blocklen=16, Out the QCryptographicHash::hash returns a QByteArray with a length of 32.
If I rewrite the constructor like this:

// Change m_blocklen(16) by m_blocklen(32)
QAESEncryption::QAESEncryption(QAESEncryption::AES level, QAESEncryption::MODE mode)
    : m_nb(4), m_blocklen(32), m_level(level), m_mode(mode)

it seems to work

I do not know anything about cryptography.
Best regards
Patrice

Question about : Heap corruption detected: after normal block.....

2024-04-13_225321
When using this library for decryption, an out of memory error may occur when the length of the string to be decrypted does not match. It is currently believed that when using the mid() function on QByteArray, it may be necessary to determine if the length limit has been exceeded. Like this:

for (int i = 0; i < rawText.size(); i += m_blocklen)
{
    if (i + m_blocklen > rawText.length()) 
    {
        break;
    }
    ret.append(invCipher(expandedKey, rawText.mid(i, m_blocklen)));
}
break;

I am not good at English, so I use translation tools. Please forgive me.Thank you!😄

use

I use it(QT) to encrypt(AES128,ECB),key.length > 16
And I want to use nodejs to decrypt , It failed
Does it have anything to pay attention to, or does it not support
Of course, it may be my code problem, I hope to get some useful information
thx

Regarding the problem that the padding is not removed after decryption

Hi, after the string is encrypted, it is decrypted. The decrypted string is filled with other characters, such as:
Before encryption:NAAAACA9ARUMGMCJ2EPLCHKTF
After decryption:NAAAACA9ARUMGMCJ2EPLCHKTF\x80\x00\x00\x00\x00\x00\x00
I checked the source code, should I call removePadding function before QAESEncryption::decode returns to solve the problem?

it craches

i tried using one of your examples and it crashes

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
ASSERT: "uint(i) < uint(size())" in file C:/Qt/Qt5.11.0/5.11.0/mingw53_32/include/QtCore/qbytearray.h, line 474

I'm using windows 7
qt 5.11.0

PKCS#7 padding problem

Hi,
In pkcs # 7 padding,
If the size of the raw text is divided by the block size, should the raw text be padded to the size of the block size?
If you divide by block size, you are not padding.
(in getPadding (), if size == 0, return QByteArray ())

AES Encryptation Length short in my Qt App.

Please I have a problem in Qt-AES library, when I encrypt text multiple times in the same app, I get a text encrypted with less characters, and when I desencrypt in other app not desencrypt it.

App broken with msvc compiler in last version

I am using a machine with windows 10 installed and using Qt v15.5.2 with msvc x64 compiler.
Since last updates, it is used mingw macros I think for speeding up the thing, but now msvc is not supported.

Tested also with 1.0 version and the app is compiled under my system.

Support protocol buffers (protobuf)

Hi,

Does anyone know if Qt-AES is supporting the usage of protocol buffers (protobuf) ?

Because I tried to encode and decode a QByteArray with protobuf data and after decoding it's unable to retrieve the correct information.

undefined reference to `bool QTest::qCompare

Hi,

While compiling it is giving undefined reference error at

/lan/ops/cdnshelp/cops/users/smunish/crypto/Qt-AES-master/Qt-AES-master/unit_test/aestest.cpp:197: undefined reference to `bool QTest::qCompare<QString, QByteArray>(QString const&, QByteArray const&, char const*, char const*, char const*, int)'

QAESEncryption Level is not working

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 ?

ASSERT

ASSERT: "uint(i) < uint(size())" in file c:\work\build\qt5_workdir\w\s\qtbase\src\corelib\tools\qbytearray.h, line 464

Decrpytion with AES-NI not working

I enabled the decryption methods in the aesni.h files and used the code from #if USE_INTEL_AESNI_IF_AVAILABLE from the encoding step for the decode method, so that I can feed AES_ECV_decrypt() with the right parameters. Unfortunately though, the computed data isn't the decrypted version of my encrypted original data.

Anyone have an idea on how to fix it or do you need further information on my code?

The Padding::ZERO work not well

Hi all, I'm a newbie.
I tried to use Padding::ZERO with CBC mode.
However, the output is not fine.
I tested this output on some online tool and the result is not matching
Is it an issue?

Some of decrypted data is corrupted

Hi

I am trying to decrypt data that encrypted with (php openssl) with AES_256 - CBC

the IV is = QByteArray iv = "0000000000000000";

the first section of the data is corrupted and the last is good

what is the problem and how to solve it ?

let me know if you need more info

<Suggestion: Expand beyond Qt-AES>

Hey,

Qt-AES is almost perfect and very easy to use and integrate, which makes it standout from the competition, so in this light can you expand beyond Qt-AES, and create similar encryption classes for the other four AES finalists?

My suggestion is first to expand and create:

Qt-MARS
Qt-RC6
Qt-Serpent
Qt-Twofish

And maybe, (as a hashing function) who knows:

Qt-Whirlpool

Let me know what do you think.

compatibility with openssl issue

Hi
Is there a method to derive iv from password ? without salt, basically I need to replicate this openssl command on iOS and Android:
openssl enc -aes-128-ecb -a -K MY_KEY -k 'MY_PASS' -in mesg.enc

Best,
Marek

suggest to add more check to decode() method paremeters

If the size of encoded data is wrong, the decode() will cause heap corruption. So suggest that decode() should verify the length of input rrawText. It the lenght is not mutiple of 16 bytes(AES block), return an empty buffer.

Example code:

    QByteArray encodedText("123456");    // wrong length
                                                                 // QByteArray encodedText("1234561234561234"); does not cause failure.
    QByteArray hashKey = QCryptographicHash::hash(seed, QCryptographicHash::Sha256);
    QByteArray decoded = QAESEncryption::Decrypt(QAESEncryption::AES_128, QAESEncryption::ECB, encodedText, hashKey);
    QByteArry res = QAESEncryption::RemovePadding(decoded);

This will cause

HEAP CORRUPTION DETECTED: after Normal block (#42796) at 0x0000023DF89F0770.
CRT detected that the application wrote to memory after end of heap buffer.

removePadding problem

Hi, I think to find a problem in removePadding method.

below the code:
QAESEncryption encryption(QAESEncryption::AES_256, QAESEncryption::CBC);


    QString inputStr("Carte di credito");
    QString key("[email protected]");
    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() << encodeText << "|" << decodeText << "|"<< decodedString;

this is the result:

"\x13\xE8\x1ES\x1Bv\xBF\xDCp\xF4i\xB7\xF2\xB0\xD1" | "Carte di credito" | ""_

the value of encodeText and decodeText I think are ok but decodedString is empty after removePadding assignment.

I don't know cryptography well and I don't know how to help you.

This code is tested on:
MacBook Pro 2017, macOS 10.14 and QT 5.11.2

Thanks for the nice project

Bye

QByteArray index out of bound

Hi, im using your source in my project and installing the app in Android 7.
THe code crash with this error:
A/MyApp: ASSERT: "uint(i) < uint(size())" in file C:\Qt\5.13.2\android_armv7\include\QtCore/qbytearray.h, line 481
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 28083 (qtMainLoopThrea)

Doing a lot of Debugging I arrived in expandedKey method:
row 218-> QByteArray roundKey(key); //The size of this element is 15
row 222-> m_nk = 4, m_nb = 4, m_nr = 10

for(i = m_nk; i < m_nb * (m_nr + 1); i++) { tempa[0] = (quint8) roundKey.at((i-1) * 4 + 0); tempa[1] = (quint8) roundKey.at((i-1) * 4 + 1); tempa[2] = (quint8) roundKey.at((i-1) * 4 + 2); tempa[3] = (quint8) roundKey.at((i-1) * 4 + 3);

When the code reach tempa[3] at row 227 with roundKey.at(), It tries to access the 15 element and goes into FATAL because the first loop is i = 4 so => (4-1) * 4 + 3 = 15 and roundKey last index is 14.
What can I do? I always use your class with my Android 9-10 and have no problem at all. Today I broke my phone and I used an old one and get this drama.
Hope my LOG can help you understand the problem, let me know as soon as you can

encode error

ASSERT: "uint(i) < uint(size())" in file C:/Qt/5.12.0/mingw73_64/include/QtCore/qbytearray.h, line 481
it do this when it goes to the line 416 qaesencryption.cpp
QByteArray expandedKey = expandKey(key);
windows 7 qt 5.12

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.