New SimpleCrypt page
Page |
2 |
Aha, got it all sorted out, thanks
I had my suspicions on that, but thought that the “<<” and “>>” operators may use seperate index variables.
Andre: it would be great if you could incorporate in the Example usage code the following so it works out of the box.
Because newbies like myself:
- copy + paste + compile
- if it works -> adapt to needs
- if it doesn’t -> get lost in the simplest things
Although I must admit that I am learning loads of things through all these problems I get myself into.
Gerolf: Once again thanks for your quick and effective response.
paucoma, thank you for your comments and suggestions. I have changed the wiki page accordingly. I am glad you solved the problem, and that it turned out the class itself was not at fault ;-)
I must admit that I wrote the examples directly in the wiki page, and thats when errors like these happen. Sorry about that! I hope the current version is more managable? Note that I was talking about “at the other end”, implying that the decryption code was not meant to be used in the same function (and thus, implicitly, with the same buffer).
Hi Andre,one suggestion to the wiki page:
In the section SimpleCrypt in use it would be nice to have a list of the encryp/decrypt functions. You state thete are two times 4, but not the names :-)
this means searching inside the code :-)The rest sound really god. Thanks for the article.
Fair enough, done. :-)
Thanks for the praise.
Hi Andre,
I’m currently reading your second article, and found the following here [developer.qt.nokia.com] :
The payload data block’s contents are encrypted with a four byte (quint64) key.
quint64 is a 64 bit integer, which means 8 byte.
so also in the snipet page, you say:
- SimpleCrypt crypto(Q_UINT64_C(0x7F29B208)); //some random number
this is just a 32 bit number, not 64 bit.
- void SimpleCrypt::splitKey()
- {
- m_keyParts.clear();
- m_keyParts.resize(4);
- for (int i=0;i<4;i++) {
- quint64 part = m_key;
- for (int j=i; j>0; j--)
- part = part >> 8;
- part = part & 0xff;
- m_keyParts[i] = static_cast<char>(part);
- }
- }
this also only uses 4 bytes, not 8.
some additional topics:
in Decrypted payload [developer.qt.nokia.com]
SH1 and CRC have the same description:
In case the Protection Checksum flag has been set, the layout of the decrypted payload looks like this:
I think this is just a copy paste error.
As I’m through now, no more things :-)
Very good article, interesting to read. Thanks.
You must log in to post a reply. Not a member yet? Register here!




