Source Code:
http://pastebin.com/kYPevJqU
NOTE: I will add a salt once this works dont even bring it up.NOTE2: For the program to accept the password it must be at least 7 characters long.
http://pastebin.com/kYPevJqU
NOTE: I will add a salt once this works dont even bring it up.
local function sha256(msg)
msg = preproc(msg, #msg)
local H = initH256({})
for i = 1, #msg, 64 do digestblock(msg, i, H) end
return str2hexa(num2s(H[1], 4) .. num2s(H[2], 4) .. num2s(H[3], 4) .. num2s(H[4], 4) ..
num2s(H[5], 4) .. num2s(H[6], 4) .. num2s(H[7], 4) .. num2s(H[8], 4))
end
It's defined as a local function in the "api" so you don't have acess to it when using os.loadAPI.Thank you I see now, that makes a lot of sense.It's defined as a local function in the "api" so you don't have acess to it when using os.loadAPI.local function sha256(msg) msg = preproc(msg, #msg) local H = initH256({}) for i = 1, #msg, 64 do digestblock(msg, i, H) end return str2hexa(num2s(H[1], 4) .. num2s(H[2], 4) .. num2s(H[3], 4) .. num2s(H[4], 4) .. num2s(H[5], 4) .. num2s(H[6], 4) .. num2s(H[7], 4) .. num2s(H[8], 4)) end
Okay, I didnt know he intended it to be pasted in and not used as an API, but I can do that.Ah, I see, your script grabs the SHA stuff via PasteBin. Yeah, GravityScore's SHA script isn't an API; he intends that you paste the whole thing into your own code.