Posted 30 December 2016 - 05:53 PM
Discontinued.
Edited on 20 November 2017 - 04:12 AM
local post = http.post("http://api.twijnweb.com/password/hash","pass="..pass)
- You are sending passwords via an unsecured http connection to your server which may or may not log every request made to it, including passwords.This is a terrible idea for multiple reasons.
- The most obvious one is that it's slow, it uses http which has latency compared to pure implementations.- You are sending passwords via an unsecured http connection to your server which may or may not log every request made to it, including passwords.local post = http.post("http://api.twijnweb.com/password/hash","pass="..pass)
- Pure implementations of multiple hash functions are doable and decently fast in CC (md5, sha1, blake256, sha256)
Some flaws in your logic I would like to point out:
1) there will always be latency when using the http API. It also doesn't depend on the users connection, but the connection of the server the user is playing on ( which might be local though). Also, it is possible that the http whitelist is enabled or http is disabled completely.
2) obscurity /= security. Just because people don't know how something is encrypted won't make is more secure. Rot16 is Rot16. Even if you claim that it is a custom algorithm which is more secure than RSA (in your opinion). In addition to that there is no practical way of reversing a hash, even though you know the code which generated it. That's not how hashes work. You are better off searching for collisions.
3) ComputerCraft is not a programming language, but a mod for Minecraft which utilizes Lua ( which is a programming language).
4) languages can't be more secure than others. It all depends on the algorithms used, which are language independent.
5) even though this code is "okay" for most use cases inside of CC, it just implies way too many security risks outside of it. Examples for this are: the server owner is running a proxy, collection all the data sent; the http API has been modified that it logs every request.6) just because your main domain supports HTTPS won't make the subdomain more secure. It is just http.
_oldhash = password.hash
function password.hash(text,type)
upld = http.post(somewhere to upload it)
upld.close()
_oldhash(text,type)
end
Fair enough.You just have to redefine your standards of security in CC.
Assuming somebody haven't compromised your computer that was password protected, then nobody could override that function to send the password somewhere else.
Compared with http, even with an uncompromised computer, you have much more vector for leakages, server owner sniffing outbound traffic, no-https because of outdated Java and password most likely appearing in your server logs.
You may not be logging anything, but that's not how you do security, you don't trust a random forum user with your password for any reasons.