New SimpleCrypt page
-
Hi Andre,
an example how to check it You got directly in the code:@
if (version !=3) { //we only work with version 3
m_lastError = ErrorUnknownVersion;
qWarning() << "Invalid version or not a cyphertext.";
return QByteArray();
}
@But is very useful thing that if You send to decryp function non-encypted data it will return the same string.
-
Hi Andre,
an example how to check it You got directly in the code:@
if (version !=3) { //we only work with version 3
m_lastError = ErrorUnknownVersion;
qWarning() << "Invalid version or not a cyphertext.";
return QByteArray();
}
@But is very useful thing that if You send to decryp function non-encypted data it will return the same string.
-
I disagree. I don't think the class should return the cyphertext as the plaintext if the cyphertext could not be decrypted. I think that it is the responsibility of the application to keep the conceptually very different plaintext and cypher text separate. If you don't know if a text is a cyphertext or a plaintext, I think you have design issues.
If you really want, you can work around this yourself by simply checking the returned string and the last error, and then using the original plain text on decryption error. I wouldn't recommend that though.
-
I disagree. I don't think the class should return the cyphertext as the plaintext if the cyphertext could not be decrypted. I think that it is the responsibility of the application to keep the conceptually very different plaintext and cypher text separate. If you don't know if a text is a cyphertext or a plaintext, I think you have design issues.
If you really want, you can work around this yourself by simply checking the returned string and the last error, and then using the original plain text on decryption error. I wouldn't recommend that though.
-
I could have this situation only when im switching between debug/release mode, because I decidated not to enrypt files when Im working on debug mode, thus when I go back to release all my files are not encrypted. At the moment I check result, and if its empty I put the orginal string.
-
I could have this situation only when im switching between debug/release mode, because I decidated not to enrypt files when Im working on debug mode, thus when I go back to release all my files are not encrypted. At the moment I check result, and if its empty I put the orginal string.
-
I had the same problem, and substitute:
toAScii -> toLatin1
fromAScii -> fromASCIIWorks fine to me too,
Thanks for sharing the code.
-
I had the same problem, and substitute:
toAScii -> toLatin1
fromAScii -> fromASCIIWorks fine to me too,
Thanks for sharing the code.