This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Spice-King's profile picture

Hashing Small Amounts Of Text (Sha-1, Sha-2, Md5, Etc.)

Started by Spice-King, 26 February 2012 - 03:21 AM
Spice-King #1
Posted 26 February 2012 - 04:21 AM
I'm planning to send passwords over wireless rednet, but I know some one can sniff the net for what I'm sending with some work. I wish to make it a bit harder, think md5(password+someThingTimeBased()+"aReallyNastySalt"). How ever, said functions don't exist in ComputerCraft's lua implementation and most implementations use C libraries or don't work. Will have to work with out luajava and http APIs. Anyone know of one?


Edit: Well never mind. Stupid me. Had a file extension on it. os.loadAPI() does not like that. Used this, has both SHA-1 and HMAC-SHA1 in it as sha1('text') and hmac_sha1('key','text')
Xtansia #2
Posted 26 February 2012 - 04:51 AM
I'm planning to send passwords over wireless rednet, but I know some one can sniff the net for what I'm sending with some work. I wish to make it a bit harder, think md5(password+someThingTimeBased()+"aReallyNastySalt"). How ever, said functions don't exist in ComputerCraft's lua implementation and most implementations use C libraries or don't work. Will have to work with out luajava and http APIs. Anyone know of one?

I don't know about md5 but my String Utils API has a sha1 hashing function.
Spice-King #3
Posted 26 February 2012 - 05:19 AM
I'm planning to send passwords over wireless rednet, but I know some one can sniff the net for what I'm sending with some work. I wish to make it a bit harder, think md5(password+someThingTimeBased()+"aReallyNastySalt"). How ever, said functions don't exist in ComputerCraft's lua implementation and most implementations use C libraries or don't work. Will have to work with out luajava and http APIs. Anyone know of one?

I don't know about md5 but my String Utils API has a sha1 hashing function.
Oh, sweet. Lost of stuff to use in there. This will make it hard to find out the passwords, thanks! Don't know how I missed it.
Hawk777 #4
Posted 26 February 2012 - 08:33 AM
If you're using modems instead of bundled cable, I believe nobody can sniff the network because packets are shovelled from sender directly to recipient through native Java code rather than ever actually passing through the world.