Hash Functions

I need to Hash a value that is set to a server over ethernet. After looking I am not certain what Hash functions are available. Does anyone know if there are any standard hash functions like MD5 or SHA for the arduino?

I need to Hash a value that is set to a server over ethernet.

Why? Can you explain what you are trying to do? I don't think that generating a hash value is the answer.

I am trying to have the arduino send a message to the server and was planning on hashing the UUID, password and a timestamp in order to act as a one time password on the server. In otherwords once the hash is used to authenticate once the server will not accept it again.

I guess it's a matter of semantics. Generally a hash value is used to partition data in a hash table that contains pointers to where data is really stored, in the case where there is a large amount of data, with no reasonable way to sort the data (because the volume of data is too large to move using a traditional sort).

So, I don't think that a hash value is what you want, but, I understand your desire. Unfortunately, I have no idea how to help you.

So I take it that there are no functions that provide an MD5Sum or any other hash algorithms available on the arduino?

Are you trying to generate a "nonce"?

Not that I know of in arduino, google around for C / avr-asm implementations of various hashes, they're around.

XTEA encrypt is only 6 lines long, if low security is fine: Assuming 16char limit on passwd, encrypt concatenation of 32bit UID and 32bit time using the zero padded passwd as the key.

http://en.wikipedia.org/wiki/SHA-1 There is an awesome c implementation on sha-1 somewhere on the web, Google it. I used it for my nintendo DS a while ago.

However it it possible that sha-1 is a bit to advanced and power consuming i guess. I would just make my own hash function, as it is fairly easy. Unless you require bank security.

Here's a crypto library for AVR microcontrollers: http://www.das-labor.org/wiki/AVR-Crypto-Lib/en

(FWIW, that was the 3rd hit on google using 'AVR SHA-1' - there are tons more. This does not seem novel.)

!c

I get what you are trying to do.

I modified the AVR-Crypto MD5 implementation so that it can be used as a library.

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1272577380