290 posts
Location
St.Louis, MO
Posted 22 November 2014 - 01:16 AM
WalCrypt
Hashing algorithm
WalCrypt is a hashing algorithm I made to improve my skills. I have decided to release it to the forums today because I think it is secure. If you feel up to it please try to crack my hashing algorithm and please post how you did so. I hope you get lots of use out of WalCrypt.Code, for those people who dont use pastebin--# walCrypt by Andre A. Walia (walia6)
--# liscensed under CreativeCommons Attribution.
--# You may distribute,remix, tweak, and build
--# upon my work, even commercially, as long as
--# you credit me by my First, middle initial, and last name.
function walCrypter(toHash)
a={}
for i=1,#toHash do
a[#a+1] = string.sub(toHash,i,i)
end
b = {}
c = 0
x={}
for k,v in pairs(a) do
x[#x+1] = string.byte(v)
end
for k,v in pairs(x) do
math.randomseed(k)
c=c+math.random(1,v)
end
d=0
for k,v in pairs(x) do
math.randomseed(c)
d=math.random(1,k)
math.randomseed(v)
d=d+math.random(1,v)
end
math.randomseed(c)
f=math.random(1,#a)
ending = ""
for i=1,f do
math.randomseed(x[#x])
x[#x+1] = math.random(1,i)
end
for k,v in pairs(x) do
ending = ending..v
end
ended = 0
ending=ending..""
for i=1,#ending do
ended = ended + tonumber(string.sub(ending,i,i))
end
return tonumber(ending)/tonumber(ended)
end
Please leave reviews!
-Cheers!
please leave feedback
Edited on 24 November 2014 - 12:03 AM
392 posts
Posted 24 November 2014 - 12:32 AM
I don't really know much about encryption or anything, but does this just encrypt data with no way to decrypt it?
3057 posts
Location
United States of America
Posted 24 November 2014 - 12:50 AM
My feedback: this is useless.
I compared the results several times over, using this:
for i = 1, 10 do
print( walCrypter( "HI" ) == walCrypter( "HI" ) )
end
Out of the ten printed statements, 5 were true and 5 were false.
Raw results:
true
false
false
false
true
false
true
true
false
true
In conclusion: this has a 50/50 chance of matching itself, making the hash entirely useless.
290 posts
Location
St.Louis, MO
Posted 25 November 2014 - 11:54 PM
My feedback: this is useless.
I compared the results several times over, using this:
for i = 1, 10 do
print( walCrypter( "HI" ) == walCrypter( "HI" ) )
end
Out of the ten printed statements, 5 were true and 5 were false.
Raw results:
true
false
false
false
true
false
true
true
false
true
In conclusion: this has a 50/50 chance of matching itself, making the hash entirely useless.
I have not been able to reproduce this. Do you mind telling me if you are using an emulator/what version of cc you are using
3057 posts
Location
United States of America
Posted 26 November 2014 - 12:03 AM
-snip-
I have not been able to reproduce this. Do you mind telling me if you are using an emulator/what version of cc you are using
I used
Mimic.
Edit: I just tested with MC 1.7.10, CC 1.65. It works fine with that for reasons unknown.
Edited on 25 November 2014 - 11:09 PM
290 posts
Location
St.Louis, MO
Posted 26 November 2014 - 12:19 AM
Ah, ok that's what i thought.
Now that it works for you, any feedback?
3057 posts
Location
United States of America
Posted 26 November 2014 - 12:48 AM
Alright I guess, I don't know much about this sort of thing. However, it seems impossible to get the original content back, which is the idea behind hashing. Although this works, I will continue to use GravityScore's sha256 port, if only because it's a hash thats been tested against real hackers, and held.