This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Hancomat55's profile picture

Unhackable Password Door (Simple)

Started by Hancomat55, 11 October 2012 - 01:43 AM
Hancomat55 #1
Posted 11 October 2012 - 03:43 AM
Well I hope you enjoy just put in your password where it says "Password", keep the parenthesis though.


while true do
os.pullEvent =os.pullEventRaw
term.clear()
term.setCursorPos(1, 1)
write("Please Enter Password: ")
input = read("*")
if input == "Password" then
redstone.setOutput("right", true)
sleep(3)
redstone.setOutput("right", false)
sleep(1)
os.reboot()
else
print("Incorrect! Try again later.")
sleep(1)
print("Shutting Down")
sleep(1)
os.reboot()
end
end

That is all :P/>/>
wjykk #2
Posted 11 October 2012 - 05:24 AM
I'd assume it's unhackable as long as you can't terminate the program and look through its source code. Otherwise, it's no better than the simplest solutions.
Luanub #3
Posted 11 October 2012 - 05:33 AM
He has ctrl+t prevention so you can not terminate it.

You could however drop a disk drive next to the computer with a blank startup file on a disk and take a look at the code.
MrZuribachi #4
Posted 11 October 2012 - 01:14 PM
By attaching a disk drive at the computer and using a floppy disk with any startup (for example a startup showing "CraftOS 1.4" like the vanilla one), you just have to enter any crap into the computer and the computer will automatically reboot cause of the os.reboot-line. Instead I'd use shell.run("startup"), so the computer doesn't restart. Instead the startup will run up again and there will be no boot from any floppies attached. (Just my suggestion)

Edit: Read luanub's post as well, but with restating his arguement I aimed to give a better focus on the actual problem and a possible solution.
1lann #5
Posted 11 October 2012 - 02:48 PM
By attaching a disk drive at the computer and using a floppy disk with any startup (for example a startup showing "CraftOS 1.4" like the vanilla one), you just have to enter any crap into the computer and the computer will automatically reboot cause of the os.reboot-line. Instead I'd use shell.run("startup"), so the computer doesn't restart. Instead the startup will run up again and there will be no boot from any floppies attached. (Just my suggestion)

Edit: Read luanub's post as well, but with restating his arguement I aimed to give a better focus on the actual problem and a possible solution.
Can't you just use ctrl+s or ctrl+r then?
MrZuribachi #6
Posted 11 October 2012 - 03:10 PM
Look at the following line:

os.pullEvent = os.pullEventRaw
This prevents users from using any keys, like CTRL+S, CTRL+T, CTRL+R and whatever.
GopherAtl #7
Posted 11 October 2012 - 03:12 PM
No, it doesn't. It only prevents ctrl-t.

I keep hearing people say it blocks them all; does nobody actually test these things before repeating them?
MrZuribachi #8
Posted 11 October 2012 - 03:42 PM
Well, I already tested it and none of my programs got unfluenced by pressing CTRL+S / R after using the os.pullEventRaw-line.
KevinW1998 #9
Posted 11 October 2012 - 04:34 PM
Normaly only ctrl+t is blocked!
Cranium #10
Posted 11 October 2012 - 04:35 PM
Well, I already tested it and none of my programs got unfluenced by pressing CTRL+S / R after using the os.pullEventRaw-line.
That is a lie. A flat-faced lie. CTRL+S and CTRL+R are hardcoded into the java code. There is no way to prevent those from affecting your code.
robhol #11
Posted 11 October 2012 - 04:41 PM
If you -could- prevent CTRL-S and CTRL-R, there'd be no way to recover from a critical bug in your code, like an infinite loop.

Also, no offense, but this isn't useful, there are hundreds of scripts just like this except better. People need to stop posting completely basic "security systems".
Doyle3694 #12
Posted 11 October 2012 - 04:47 PM
This is like "I just learned os.pullEventRaw(), nobody else know about it so I'ma put my code on teh forums with the pros so they can see how skilled I am", no offence, but really? If everyone discovering os.pullEvent() = os.pullEventRaw() Would post their program then the forum server would run out of disk space. seriously.
Cranium #13
Posted 11 October 2012 - 04:56 PM
We're not here to bash you exactly, but you did make one critical mistake: You flat out stated something that is known widely to almost all veteran coders here on the forums. You said that your program was unhackable. It is not. There is no such thing as an unhackable program through computercraft, because it has been designed to be such a way. If you could not terminatte or restart a program, this could cause massive problems with hackers, and so it has been made so that cannot happen.
GopherAtl #14
Posted 11 October 2012 - 05:50 PM
Just a sortof side note, that might help all the people who wish they could completely block ctrl-r, ctrl-s, and booting from floppies.

People think of hacking as just being the malicious people/programs that get into your computer and mess it up. But hacking is also what you have to do to get in and repair that broken computer.

So bottom line is no matter what you do, short of server mods that protect blocks, people will be able to hack your computers no matter what - but that means you will always be able to get back in the computer to fix it, too. The latter is crucial, and the two can't be separated, so you'll just have to live with the former.
Exerro #15
Posted 11 October 2012 - 05:59 PM
it is almost possible to prevent disk booting and if the door code is startup then rebooting doesn't matter…if you have a thing in your program where it deletes the disk startup if there is one then the only way to get through the doorlock is using ctrl-s then putting an unaffected disk in
maybe put this in your code so its not just like the daily crappy doorlock that people think will revolutionize computercraft (no offense meant)
Cranium #16
Posted 11 October 2012 - 06:50 PM
But you can't stop someone from using ctrl s, putting the disk in, then restarting the computer.
Left4Cake #17
Posted 13 October 2012 - 02:10 AM
Well, I already tested it and none of my programs got unfluenced by pressing CTRL+S / R after using the os.pullEventRaw-line.
That is a lie. A flat-faced lie. CTRL+S and CTRL+R are hardcoded into the java code. There is no way to prevent those from affecting your code.

Is there a way to cause the computer to reboot on pressing CTRL, thus not allowing the 1 sec required for CTRL+ hotkeys..
Hancomat55 #18
Posted 13 October 2012 - 02:43 AM
Well, I already tested it and none of my programs got unfluenced by pressing CTRL+S / R after using the os.pullEventRaw-line.
That is a lie. A flat-faced lie. CTRL+S and CTRL+R are hardcoded into the java code. There is no way to prevent those from affecting your code.

Is there a way to cause the computer to reboot on pressing CTRL, thus not allowing the 1 sec required for CTRL+ hotkeys..
I dont know, probably not because it is all scripted together. But you could try looking in the CC folder
tommyroyall #19
Posted 13 October 2012 - 04:57 AM
Easy Solution: Disk boot from the right side. Boot it up with a startup that says:

os.run("shell")
-- This will bypass anything set as a startup and head the user straight to the shell. There they can do whatever they want, hopefully in my case break this wretched lock :.
Hancomat55 #20
Posted 13 October 2012 - 05:43 AM
Easy Solution: Disk boot from the right side. Boot it up with a startup that says:

os.run("shell")
-- This will bypass anything set as a startup and head the user straight to the shell. There they can do whatever they want, hopefully in my case break this wretched lock :.
That is a good one and i doubt it is possible to hack into
Zoinky #21
Posted 13 October 2012 - 11:15 AM
Well, I already tested it and none of my programs got unfluenced by pressing CTRL+S / R after using the os.pullEventRaw-line.
That is a lie. A flat-faced lie. CTRL+S and CTRL+R are hardcoded into the java code. There is no way to prevent those from affecting your code.

Is there a way to cause the computer to reboot on pressing CTRL, thus not allowing the 1 sec required for CTRL+ hotkeys..

Actually, It doesn't matter if the program closes/the computer reboots. CTRL + S/R will always work. As Cranium said, They're hardcoded in.
1lann #22
Posted 13 October 2012 - 03:50 PM
Easy Solution: Disk boot from the right side. Boot it up with a startup that says:

os.run("shell")
-- This will bypass anything set as a startup and head the user straight to the shell. There they can do whatever they want, hopefully in my case break this wretched lock :.
That is a good one and i doubt it is possible to hack into
Open the disk drive, remove the disk and replace it with a disk with a blank startup? It's impossible to make something in CC unhackable unless you have some 3rd party plugin/mod which protects the disk drive and/or computer. Ex. on a bukkit sevrer you can use lwc or lockette if the server has them installed.
B00mX0r #23
Posted 14 October 2012 - 12:43 AM
I found a hack

Step 1. Place redstone torch next to door.
Step 2. h4x3d.

tl;dr: It's more secure to make doors inverted so this doesn't happen on servers.
Zoinky #24
Posted 14 October 2012 - 02:52 AM
I found a hack

Step 1. Place redstone torch next to door.
Step 2. h4x3d.

tl;dr: It's more secure to make doors inverted so this doesn't happen on servers.

Yep. Pistons! :)/>/>
ChaddJackson12 #25
Posted 14 October 2012 - 04:14 AM
Well, I already tested it and none of my programs got unfluenced by pressing CTRL+S / R after using the os.pullEventRaw-line.
That is a lie. A flat-faced lie. CTRL+S and CTRL+R are hardcoded into the java code. There is no way to prevent those from affecting your code.

Is there a way to cause the computer to reboot on pressing CTRL, thus not allowing the 1 sec required for CTRL+ hotkeys..
I dont know, probably not because it is all scripted together. But you could try looking in the CC folder
Yes it is possible, I did it in one of my programs, but they could still put a disk in then press Ctrl, so there still is no protecting that.
ChaddJackson12 #26
Posted 14 October 2012 - 04:19 AM
I think I may have found a solution to the problem about boot disks!

When someone's presses Ctrl, have the computer reboot; but before rebooting have it delete disk/startup, or even multiple disk startups; and THEN reboot the computer, meaning that if they put a disk in then press control, their disk would no longer have a startup to exit the normal program!

Tell me how well this works for you!
Like this:

repeat
   event, key = os.pullEvent("key")
   os.sleep(0.1)
until key == (# for LCTRL) or key == (# for RCTRL) or key == (# for ENTER)
If key == (# for LCTRL) or key == (# for RCTRL) then
   if fs.exists("disk/startup") then
      fs.delete("disk/startup")
      os.reboot()
   else
      os.reboot()
   end
elseif key == (# for ENTER) then
   -- password script
end
Sorry I don't have the numbers for the IDs of the keys but I am unsure of them and am too lazy to look for them at the moment :3. Hope that I helped
Hancomat55 #27
Posted 14 October 2012 - 04:51 AM
I think I may have found a solution to the problem about boot disks!

When someone's presses Ctrl, have the computer reboot; but before rebooting have it delete disk/startup, or even multiple disk startups; and THEN reboot the computer, meaning that if they put a disk in then press control, their disk would no longer have a startup to exit the normal program!

Tell me how well this works for you!
Like this:

repeat
   event, key = os.pullEvent("key")
   os.sleep(0.1)
until key == (# for LCTRL) or key == (# for RCTRL) or key == (# for ENTER)
If key == (# for LCTRL) or key == (# for RCTRL) then
   if fs.exists("disk/startup") then
	  fs.delete("disk/startup")
	  os.reboot()
   else
	  os.reboot()
   end
elseif key == (# for ENTER) then
   -- password script
end
Sorry I don't have the numbers for the IDs of the keys but I am unsure of them and am too lazy to look for them at the moment :3. Hope that I helped
That is a pretty good idea. I could see that working. :)/>/>
Cranium #28
Posted 14 October 2012 - 06:10 AM
Just tested. Still responds to Ctrl + S. bypassed still…
Fatal_Exception #29
Posted 14 October 2012 - 07:56 AM
I think I may have found a solution to the problem about boot disks!

When someone's presses Ctrl, have the computer reboot; but before rebooting have it delete disk/startup, or even multiple disk startups; and THEN reboot the computer, meaning that if they put a disk in then press control, their disk would no longer have a startup to exit the normal program!

Tell me how well this works for you!
Like this:

repeat
   event, key = os.pullEvent("key")
   os.sleep(0.1)
until key == (# for LCTRL) or key == (# for RCTRL) or key == (# for ENTER)
If key == (# for LCTRL) or key == (# for RCTRL) then
   if fs.exists("disk/startup") then
	  fs.delete("disk/startup")
	  os.reboot()
   else
	  os.reboot()
   end
elseif key == (# for ENTER) then
   -- password script
end
Sorry I don't have the numbers for the IDs of the keys but I am unsure of them and am too lazy to look for them at the moment :3. Hope that I helped

All you'd have to do is shut the computer down, then switch disks.
matejdro #30
Posted 14 October 2012 - 08:41 AM
I think it's secure enough for door lock. If someone can place disk drive next to it, then he can probably just break the door or place down lever.

Cranium: what about having two computers that keeps starting each other? That way you cannot swap disks fast enough.
robhol #31
Posted 14 October 2012 - 08:44 AM
I found a hack

Step 1. Place redstone torch next to door.
Step 2. h4x3d.

tl;dr: It's more secure to make doors inverted so this doesn't happen on servers.

If you actually CAN place/destroy stuff in the area, use 5 seconds and dig around the door…
Zoinky #32
Posted 14 October 2012 - 10:01 AM
You could just simply integrate the computer into the wall next to the door. Then only the front face is available. Place dick drive = computer face blocked.
1lann #33
Posted 14 October 2012 - 11:16 AM
It is literally impossible to do this without some form of protection. No matter what you do without block protection, it is hack able. Even the original program would work if people couldn't place/destroy blocks around the computer
ChaddJackson12 #34
Posted 14 October 2012 - 03:08 PM
I think I may have found a solution to the problem about boot disks!

When someone's presses Ctrl, have the computer reboot; but before rebooting have it delete disk/startup, or even multiple disk startups; and THEN reboot the computer, meaning that if they put a disk in then press control, their disk would no longer have a startup to exit the normal program!

Tell me how well this works for you!
Like this:

repeat
   event, key = os.pullEvent("key")
   os.sleep(0.1)
until key == (# for LCTRL) or key == (# for RCTRL) or key == (# for ENTER)
If key == (# for LCTRL) or key == (# for RCTRL) then
   if fs.exists("disk/startup") then
	  fs.delete("disk/startup")
	  os.reboot()
   else
	  os.reboot()
   end
elseif key == (# for ENTER) then
   -- password script
end
Sorry I don't have the numbers for the IDs of the keys but I am unsure of them and am too lazy to look for them at the moment :3. Hope that I helped

All you'd have to do is shut the computer down, then switch disks.
Ah, I was thinking that the commands reset at the reboot of the computer. But I guess not.
darkrising #35
Posted 14 October 2012 - 11:51 PM
Server plugins are always nice, stop people placing those pesky disk drives near your door :)/>/>
Hancomat55 #36
Posted 15 October 2012 - 01:35 AM
I found a hack

Step 1. Place redstone torch next to door.
Step 2. h4x3d.

tl;dr: It's more secure to make doors inverted so this doesn't happen on servers.

If you actually CAN place/destroy stuff in the area, use 5 seconds and dig around the door…
I like your thinking :D/>/>
tommyroyall #37
Posted 15 October 2012 - 02:48 AM
You could just simply integrate the computer into the wall next to the door. Then only the front face is available. Place dick drive = computer face blocked.
Two people. One right clicks. One places drive and disk. First one runs it correctly. Job done. Teamwork. ???. PROFIT!
tommyroyall #38
Posted 15 October 2012 - 02:59 AM
So, summing this entire post and all of it's comments up: Nothing is un-hackable.
ChaddJackson12 #39
Posted 15 October 2012 - 03:48 AM
So, summing this entire post and all of it's comments up: Nothing is un-hackable.
Wrong. You can't hack something with protection; such as LWC. Otherwise, you're correct.
Blockeh #40
Posted 15 October 2012 - 12:01 PM
But you can't stop someone from using ctrl s, putting the disk in, then restarting the computer.
But you could always add a code so when a disk is entered just shell.run("startup") to make it run the computers startup again.
Doyle3694 #41
Posted 15 October 2012 - 01:08 PM
can't you put a diskdrive to the east(because that's what minecraft registers first?) and have that startup refer to the computer startup
D3matt #42
Posted 15 October 2012 - 05:30 PM
By attaching a disk drive at the computer and using a floppy disk with any startup (for example a startup showing "CraftOS 1.4" like the vanilla one), you just have to enter any crap into the computer and the computer will automatically reboot cause of the os.reboot-line. Instead I'd use shell.run("startup"), so the computer doesn't restart. Instead the startup will run up again and there will be no boot from any floppies attached. (Just my suggestion)

Edit: Read luanub's post as well, but with restating his arguement I aimed to give a better focus on the actual problem and a possible solution.
Why re-run the program at all? Just use a loop.
rhyleymaster #43
Posted 09 November 2012 - 03:15 PM
Well I hope you enjoy just put in your password where it says "Password", keep the parenthesis though.


while true do
os.pullEvent =os.pullEventRaw
term.clear()
term.setCursorPos(1, 1)
write("Please Enter Password: ")
input = read("*")
if input == "Password" then
redstone.setOutput("right", true)
sleep(3)
redstone.setOutput("right", false)
sleep(1)
os.reboot()
else
print("Incorrect! Try again later.")
sleep(1)
print("Shutting Down")
sleep(1)
os.reboot()
end
end

That is all :unsure:/>/>

This infact, is a terrible system. There is no way to eliminate hacking WITHOUT ALTERING THE ROMS.
rex41043 #44
Posted 09 November 2012 - 04:47 PM
use a boot disc…
Zoinky #45
Posted 09 November 2012 - 10:18 PM
use a boot disc…

I think it has something to do with there you place the disk drive. (Eg. It'll boot from the front side if there are disk drives on the front and back.)
TheVarmari #46
Posted 10 November 2012 - 02:45 AM
*endless facepalm*
See, the problem here is that nothing is unhackable.
Without plugins, you could just destroy the door or place a lever.
With plugins, it might be impossible, but that's not vanilla.
You can place a disk drive and a blank startup. Now, sure, the program might be in a loop that prevents that.
CTRL + S that b***h.
Now do it. Poof. "Hacked".
Pressing CTRL reboots? B***h please, Press CTRL S, open the computer before 1 second goes away. To sleep goes the computer.

See, there is no such things as "unhackable" unless it is prevented with server-side plugins or spawn area protection.
Let's just stop arguing please. It's not worth it.

TheVarmari.. out!