Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("sha")
- sha.init("sha256")
- write("username: ")
- local u = read()
- write("password: ")
- local p = read("*")
- local salt = math.random( 1111, 9999 )
- local hashed1 = sha.sha256( p )
- local hashed = sha.sha256( hashed1 .. salt )
- fs.makeDir( "Users/" .. u )
- local f = fs.open("Users/" .. u .. "/.p", "w")
- f.write( hashed .."\n"..salt.."\n"..hashed1 )
- --f.writeLine( salt )
- f.close()
- fs.makeDir( "Users/"..u.."/Files" )
Add Comment
Please, Sign In to add comment