Exabyte the Protogen 0 Posted December 20, 2017 Share Posted December 20, 2017 /This is my first program what it does is when you boot up the computer it asks for a password the install it: (Type these in the computer) 1. pastebin get 036sY9DN PassBlocker 2. edit .shrc and add /home/PassBlocker to the code 3. edit PassBlocker 4. find the code that says "Set Password Here" and replace that with the password you want 5. reboot and try it! An installer for this program will come. eventually. if the password is correct, it just goes to the shell if the password in incorrect, it turns the pc off, forcing the person to re-confront the password system, making it impossible to crack it. (in person anyway. you probably could get past it remotely) thx to anyone who tries it any support with the installer is appreciated Edit: Thanks to Molinko for the new version here! https://pastebin.com/1t0iM9t8 Quote Link to post Share on other sites
Molinko 43 Posted December 20, 2017 Share Posted December 20, 2017 Okay. I cracked it. I think you're going to have to do some more testing. How: Hold ctrl+c. This tells the os to terminate the running program(yours)... Here are some small tips. local computer = require("computer") print("Whats The Password?") local Password = io.read() -- # this is where ctrl+c can be a problem for you. if Password == "password" then print("Passowrd Accepted") os.sleep(1) else print("Password Denied") computer.stop() -- # This doesn't even work. 'stop' is a device method. You've loaded the 'computer' library. use 'computer.shutdown(true)' instead. end Here is a version of your program that will fix users like me being able to bypass it. local computer = require("computer") local term = require("term") print("Whats The Password?") -- # term.read or io.read will throw an error from within your program when ctrl+c is pressed. -- # supress this with luas' pcall function. It calls term.read for us. local ok, Password = pcall(term.read, { dobreak = false, pwchar = "*" }) if ok then -- # not sure why but term.read add a space to the end of the returned string. Trim that shit. Password = string.sub(Password, 1, #Password - 1) end if Password == "password" then print("Password Accepted") -- # fixed a typo in "Password Accepted" -- os.sleep(1) # not needed here. the user shouldn't wait to use his/her pc. else print("Password Denied") os.sleep(1.5) -- # sleep here instead to give time to inform the user they input an incorrect password. computer.shutdown(true) -- #reboot. Note im using 'shutdown' the lib method not the device method 'stop'. end I hope this helps. Quote Link to post Share on other sites
Exabyte the Protogen 0 Posted December 21, 2017 Author Share Posted December 21, 2017 Umm... Molinko? the program works. for me at least. the help at the bottom was for an installer, so you can just install and use. Edit: After a reread, i understand what you are doing. you are making the program more secure for me. Don't get me wrong, i appreciate the support from you, but i only asked for help with the core features. but i don't want to do just trial and error, but i don't want to be pointed around the whole time. i want a mix of both, by getting help with the core features of my programs while making the auxiliary features and forks by myself. i hope you take no offence Molinko. Quote Link to post Share on other sites