QString SimpleCrypt::decryptToString(QByteArray cypher) { QByteArray ba = decryptToByteArray(cypher); QString plaintext = QString::fromUtf8(ba, ba.size()); return plaintext; }
QByteArray SimpleCrypt::decryptToByteArray(const QString& cyphertext) { QByteArray cyphertextArray = QByteArray::fromBase64(cyphertext.toAscii()); QByteArray ba = decryptToByteArray(cyphertextArray); return ba; }
QString SimpleCrypt::decryptToString(const QString &cyphertext){ QByteArray cyphertextArray = QByteArray::fromBase64(cyphertext.toAscii()); QByteArray plaintextArray = decryptToByteArray(cyphertextArray); QString plaintext = QString::fromUtf8(plaintextArray, plaintextArray.size()); return plaintext; }