Jump to content
  • Sky
  • Blueberry
  • Slate
  • Blackcurrant
  • Watermelon
  • Strawberry
  • Orange
  • Banana
  • Apple
  • Emerald
  • Chocolate
  • Charcoal
Exabyte the Protogen

PassBlocker - an on boot password system

Recommended Posts

/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

Link to post
Share on other sites

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.

Link to post
Share on other sites

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.