Guest User

mkuser

a guest
Jul 6th, 2016
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.42 KB | None | 0 0
  1. os.loadAPI("sha")
  2. sha.init("sha256")
  3. write("username: ")
  4. local u = read()
  5. write("password: ")
  6. local p = read("*")
  7. local salt = math.random( 1111, 9999 )
  8. local hashed1 = sha.sha256( p )
  9. local hashed = sha.sha256( hashed1 .. salt )
  10. fs.makeDir( "Users/" .. u )
  11. local f = fs.open("Users/" .. u .. "/.p", "w")
  12. f.write( hashed .."\n"..salt.."\n"..hashed1 )
  13. --f.writeLine( salt )
  14. f.close()
  15. fs.makeDir( "Users/"..u.."/Files" )
Add Comment
Please, Sign In to add comment