Hi
I have written a client-server application using sockets and my own protocols.
What I am seeking to achieve is the accurate (checkable) transmission of encrypted data over the internet between different platforms.
It runs very well in an all Mac environment. My difficulty is with the accurate transmission of data between the two platforms. As the application will transmit sensitive information I have written an encryption package and error notification process into the protocol. The question I have is how and when to apply the mactoiso and isotomac functions.
The sending logic is as follows:
1) the message arrives at my dispatching routine
2) the md5digest routine is applied to the message and added at the front of the message for transmission
3) the message is encrypted using a combination of the rc4 package made available by one of this community together with the inbuilt encodeB64 routine
4) the message is sent with a simple "end of message" string appended
The receiving logic is as follows:
1) the message arrives at my receiving routine
2) it is checked for completeness of transmission using the "end of message" string which is cut from the message
3) the message is decrypted
4) the first 16 characters (the md5digest portion) are cut and put into checksum1
5) the md5digest of the remaining message is performed on the receiving machine and put into checksum2
5) if the checksums agree then the message is good
The server is always a Mac. If the receiving machine is a Windows machine, which of the above process are dependent on the text encoding
a) the md5digest?
b) the rc4 routine?
c) the encodeB64 routine?
ie. how can I achieve both encryption and the capacity to verify the integrity of the message when sending text data over the internet between machine running two different platforms.
I would appreciate any help as I have so far been unable to track down any advice from the resources available and I can't get it to work - so far.
Alex
Windows and Mac - Text Encodings
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Windows and Mac - Text Encodings
I think that the correct answer to your question is "nowhere".The server is always a Mac. If the receiving machine is a Windows machine, which of the above process are dependent on the text encoding
a) the md5digest?
b) the rc4 routine?
c) the encodeB64 routine?
Mostly because the encoding changes nothing about the chars that you send, as long as you don't treat them as chars. all the build in things (md5digest, binaryencode) do not care about encoding. However, when it comes time to show your data in a field, you might need to use mactoiso() on it (after you verified it). You wrote that you use some community made stuff, and it is of course possible that those do funky stuff, so it's possible that they expect encodings, despite being binary approaches. Maybe the md5Digest is too smart for it's own good, taking char encoding into account (I highly doubt this).
I haven't tested any of my theories of course.
To test where the problem is, I suggest peeling off layers from last to first, because one of the steps is obviously doing something funky.
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: Windows and Mac - Text Encodings
Hi again
Yes you are absolutely right and I have just spent the last few hours doing just what you suggested; there were some errors in my code although exactly where the error giving me the problem was coming from was unclear. But for me the great thing is that all my database calls and encrypted, checked transmissions are now working flawlessly so on to building the really useful stuff.
The rc4 routine (the community stuff) is working fine now too.
Thank you for your advice.
Alex
Yes you are absolutely right and I have just spent the last few hours doing just what you suggested; there were some errors in my code although exactly where the error giving me the problem was coming from was unclear. But for me the great thing is that all my database calls and encrypted, checked transmissions are now working flawlessly so on to building the really useful stuff.
The rc4 routine (the community stuff) is working fine now too.
Thank you for your advice.
Alex