aboutsummaryrefslogtreecommitdiff
path: root/system/post-setup.lua
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@gmail.com>2019-07-15 21:57:44 -0400
committerAndrew Lee <alee14498@gmail.com>2019-07-15 21:57:44 -0400
commitd918fd8a79bce243a614cd99f74b7f40c639fbe1 (patch)
treeaa1ecbeff6a8a507e5749a691f56720676700579 /system/post-setup.lua
parentbc294508b9d6566add6605bb7da09d3f6b74f9bb (diff)
downloadbits-UI-d918fd8a79bce243a614cd99f74b7f40c639fbe1.tar.gz
bits-UI-d918fd8a79bce243a614cd99f74b7f40c639fbe1.tar.bz2
bits-UI-d918fd8a79bce243a614cd99f74b7f40c639fbe1.zip
Made booting faster and encrypted password
Diffstat (limited to 'system/post-setup.lua')
-rw-r--r--system/post-setup.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/system/post-setup.lua b/system/post-setup.lua
index 9ff14d6..2adc201 100644
--- a/system/post-setup.lua
+++ b/system/post-setup.lua
@@ -13,6 +13,8 @@
GNU General Public License for more details.
]]--
os.loadAPI("/system/apis/sha256.lua")
+os.loadAPI("/system/apis/json.lua")
+local config = "/home/.config"
term.clear()
term.setCursorPos(1,1)
@@ -37,7 +39,7 @@ end
print("Welcome to the bits-UI Post Setup!")
sleep(2)
print("Please enter your password.")
-print("(Don't set your real password in servers.)")
+--print("(Don't set your real password in servers.)")
local passPath = "/etc/passwd.pwd"
if fs.exists(passPath) then
@@ -46,7 +48,8 @@ if fs.exists(passPath) then
else
local passwd = read(" ")
local insertPasswd = fs.open(passPath, "a")
- insertPasswd.writeLine(passwd)
+ local hashedString = sha256.pbkdf2(passwd, 2, 32):toHex()
+ insertPasswd.writeLine(hashedString)
insertPasswd.close()
print("Thanks, I will save that.")
end