I created an encryption / decryption program, when encrypting, I store the encrypted QByteArray array in a text file.
When I tried to decrypt, I received it and then put it in the decryption method, the problem is that I need a way to convert it to QByteArray without changing the format , otherwise it will not be decrypted correctly. I mean, if the file gave me an encrypted value of 1234, and I converted it to QByteArray by going to 1234.toLatin1() , it will change the value and the decryption will not work. Do you have some ideas?
My code is:
QFile file(filename); QString encrypted; QString content; if (file.open(QIODevice::ReadOnly)) { QTextStream stream( &file ); content = stream.readAll(); } encrypted = content.replace("\n", ""); qDebug() << encrypted;
c ++ qt qstring qbytearray
James
source share