New SimpleCrypt page
-
wrote on 18 Mar 2014, 21:29 last edited by
Hey there, I am new to Qt and just came across your work ... great work by the way... could you tell me where your updated work might be? like the latest one?
cuz I seem to have a problem with this one - https://www.gitorious.org/qtdevnet-wiki-mvc/qtdevnet-simplecryptiodevide/source/a170750960820be4230ea1aff85148fc41f0dcf3:
-
wrote on 17 Nov 2014, 07:18 last edited by
Hi Andre,
Thanks for the code. It is really useful.
But is there any way to find out whether the file is encrypted or not? I would like to know if the input file is encrypted or not, if yes, then only I will decrypt it.
Thanks in advance,
Vrushali -
wrote on 23 Dec 2014, 09:26 last edited by
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.
-
wrote on 23 Dec 2014, 09:26 last edited by
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.
-
wrote on 23 Dec 2014, 14:35 last edited by
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.
-
wrote on 23 Dec 2014, 14:35 last edited by
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.
-
wrote on 24 Dec 2014, 01:57 last edited by
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.
-
wrote on 24 Dec 2014, 01:57 last edited by
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.
-
wrote on 24 Dec 2014, 01:59 last edited by
One more question to the author I changed all calls of depraced from and to ASCII to Latin1 not to Utf8. It's ok with that?
-
wrote on 24 Dec 2014, 01:59 last edited by
One more question to the author I changed all calls of depraced from and to ASCII to Latin1 not to Utf8. It's ok with that?
-
wrote on 20 Feb 2015, 14:22 last edited by
I had the same problem, and substitute:
toAScii -> toLatin1
fromAScii -> fromASCIIWorks fine to me too,
Thanks for sharing the code.
-
wrote on 20 Feb 2015, 14:22 last edited by
I had the same problem, and substitute:
toAScii -> toLatin1
fromAScii -> fromASCIIWorks fine to me too,
Thanks for sharing the code.