scripting - simple encryption tutorial? -


I am looking for a simple encryption tutorial for a string encoding in a string. I'm looking at it in general mathematical terms or psuedocode; We are doing it in a scripting language which does not have access to libraries.

We have a micro-POS (Point of Sale) system and we want to write a script which puts an encoded string under the receipt. This string will be used by a client to log on to a website and fill out a survey about the business.

Then in this string, I would like to get a three digit hard-coded location identifier, date and time; Ex: 0010912041421 Where 001 is Location Identifier, 09 years, 12 months, and 04 days, and 1421 military time (2:41 pm). In this way we know what place the defendant has visited and when

it is obvious that if we print that string, then 'code' for anyone, without actually going to our stores It would be easy to fix and complete endless surveys on our expenditure. So if we can do a simple encryption, and decode it with a pre-set key, then it will be great on the decoding website.

To reduce the chance of writing a long arbitrary string incorrectly, the encrypted string should be about the same number of characters.

Encryption will not give you any integrity protection or authentication, what you need in this application Customer knows when and where to buy, there is nothing to hide from you

Instead, consider using a Message Authentication Code. These are often based on cryptographic hashes, such as SHA-1.

In addition, you would like to consider a replay attack. Maybe I can not create my own code, but what do I have to stop by coming back with the same code? I believe that you can serve more than one customer per minute, and therefore you will want to accept duplicate timestamps from that place.

In that case, you want to add a unique identifier, it can only be unique with the timestamp. Or, you can also extend the timestamp to include tenths of seconds or seconds.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

jquery - SimpleModal Confirm fails to submit form -