I want to write a file.At first I have to encrypt the string "Banking;k1OI<]uH|V&r" using SimpleCrypt.SimpleCrypt's code:
QString SimpleCrypt::encryptToString(const QString& plaintext){ QByteArray plaintextArray = plaintext.toUtf8(); QByteArray cypher = encryptToByteArray(plaintextArray); QString cypherString = QString::fromLatin1(cypher.toBase64()); return cypherString;}
The crash happens at m_keyParts.isEmpty() with an access violation
QByteArray SimpleCrypt::encryptToByteArray(QByteArray plaintext){ if (m_keyParts.isEmpty()) { qWarning() << "No key set."; m_lastError = ErrorNoKeySet; return QByteArray(); } // [...] // Rest of the code}
Does somebody know what to do?
Thanks in advance
Edit
Stacktrace:
Accessibles.exe!QVector::isEmpty() Zeile 91 C++ Accessibles.exe!SimpleCrypt::encryptToByteArray(QByteArray plaintext) Zeile 55 C++ Accessibles.exe!SimpleCrypt::encryptToString(const QString & plaintext) Zeile 118 C++ Accessibles.exe!DataStream::save() Zeile 40 C++
Calling code:
textStream << p_simpleCrypt->encryptToString(QString("%1;%2\n").arg(bundle->category).arg(bundle->categoryId));