If all you need is something real simple that the average user will not notice, then use a series of XOR and shift statements.
The problem with not using an array to store 4 billion or so INTs is that you need a function that makes a one-on-one random card in a 4 billion INT domain. You can mix a series of XOR and shift statements to create your own, but they will be hard to crack. Even if there was a well-known one-on-one card, it would also fail. Without salt, someone could simply create a simple rainbow table to break it.
The problem with salt in two-way communication is that you must exchange data securely. Salts must be kept secret, and once you know what they are, they are meaningless.
If you want to configure a secure communication channel, see Protocol without protocol version 2 . This will give you an example of how complex communication encryption can be. I suggest you find something well known that someone else has already created and tested. Even if you use something created by someone else, if you use it incorrectly, it will not work.
gradbot Jun 06 '09 at 17:44 2009-06-06 17:44
source share