Closed kluszon closed 3 years ago
it is very strange that the data has changed, this should not be. you can show the code that encrypts and decrypts your file. And show which constructor was used to create the QRSAEncryption object
I investigate my code deeply and it isn't a problem in Qt-Secret. It works correctly. I made the mistake of saving the archive data after decoding from QByteArray to file by QFile.
Sorry, for the confusion.
What is the right way to avoid this problem? Non-significant zeros may be present in any byte array, generated as hash like SHA. BlockSize::OneByte is too slow mode. @EndrII
I'm encrypting QByteArray which contains some data and archive file content (zip format). After encrypt and decrypt data I can't decompress file data because the file isn't the same. I compared it binary. During encrypting I'm receiving:
When trying to encrypt data, problems arose, the last block contains non-significant zeros. These zeros will be deleted during the decryption process. For encoding and decode data with non-significant zeros use BlockSize::OneByte
I understand this problem and also Block Size::OneByte isn't a solution for me because the file's data can't be changed if we want to decompress it a success.
Is it any way to achieve encryption and decryption without losing data in this case?