Jump to content




need some help



  • You cannot reply to this topic
4 replies to this topic

#1 Siftos31

  • Members
  • 26 posts

Posted 06 February 2016 - 07:21 AM

I'm good on programming but I need some help

How can I do a password locked os so u can do ur own password and login and logout

sorry for my english I'm from sweden

thanks for help

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 06 February 2016 - 07:32 AM

Moved to Ask a Pro.

#3 Lupus590

  • Members
  • 2,028 posts
  • LocationUK

Posted 06 February 2016 - 02:42 PM

If the password is to be changeable then you will have to store it in a file, this will need the FS API

You may want to look into encrypting that file, there are several encryption APIs on the forums: http://www.computerc...h&fromMainBar=1

Logging in is asking the user to input something and then comparing that to the password. If you have your program run the shell then they can logout with the exit command.

You will need to make the program run on startup, you may want to provide another file to startup from.

Edited by Lupus590, 06 February 2016 - 02:45 PM.


#4 HPWebcamAble

  • Members
  • 933 posts
  • LocationWeb Development

Posted 06 February 2016 - 05:44 PM

View PostLupus590, on 06 February 2016 - 02:42 PM, said:

You may want to look into encrypting that file, there are several encryption APIs on the forums: http://www.computerc...h&fromMainBar=1

You should hash passwords when storing them. You don't need to encrypt them. Here's a good Hashing API: http://www.computerc...56-in-pure-lua/

#5 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 19 February 2016 - 01:15 PM

View PostSiftos31, on 06 February 2016 - 07:21 AM, said:

I'm good on programming but I need some help

How can I do a password locked os so u can do ur own password and login and logout

thanks for help

In develepment I have an Os that asks for a password system at startup

Here are the main password files:

--something/password--
--[leave field blank, press save, do not type this comment in]---

--startup--
shell.run('something/startup')

--something/startup-
passwordf=io.open('something/password','r')
password=passwordf:read()
passwordf:close()
print('Password Please?')
if password==nil then
term.clear()
term.setCursorPos(1,1)
shell.run('something/createpassword')
shell.run('file')
else if read('*')==password then
shell.run('file')
else
print('incorrect')
sleep(1)
os.shutdown()
end
end

--something/createpassword--
print('You neeeed a password. You can currently only have one password, and no usernames')
pw=io.open('NyanOs/password','w')
pw:write(read('*'))
pw:close()





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users