OC-PsychOS/exec/passwd.lua

7 lines
195 B
Lua
Raw Normal View History

local tA = {...}
local s=os.gensalt(16)
tA[1] = tA[1] or os.getuid()
io.write("New password for "..tA[1]..": ")
os.setuattr(tA[1],"hpass",sha.sha256(io.read("*")..s))
os.setuattr(tA[1],"salt",s)