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

Password Lock Door

Started by JackPriceBurns, 13 July 2013 - 03:20 PM
JackPriceBurns #1
Posted 13 July 2013 - 05:20 PM
I have thought of what i think is quite a good and strong password lock door code and i was wondering is there anyway to bypass it i have disabled booting from disks so that cant be done the only way which i think is possible is to destroy and place the computer but we have factions protecting my land so is there a bypass for this code?

Current Code

os.pullEvent = os.pullEventRaw
x = 1
while true do
term.clear()
term.setCursorPos(1,1)
write("Password: ")
local input = read("*")
if input == "password" then
  term.clear()
  term.setCursorPos(1,1)
  print("Password Correct")
  rs.setOutput("right",true)
  sleep(5)
  rs.setOutput("right",false)
else if input == "debug" then
  term.clear()
  term.setCursorPos(1,1)
  print("Entering Console Development Mode")
  error()
else if x == 4 then
  print("Password Entered Incorrect 3 Times")
  print("Locked For 1 Minute")
  sleep(60)
  x = 1
else
  print("Password Incorrect")
  x = x + 1
  sleep(2)
end
end
end
end


also if you are wondering why x starts as 1 not 0 its because apparently 0 is nil
Lyqyd #2
Posted 15 July 2013 - 12:44 PM
Split into new topic.

0 isn't nil. Disabling disk booting is a very bad idea.
apemanzilla #3
Posted 15 July 2013 - 12:47 PM
I've seen ways to bypass these before; when I get home I'll test it.
JackPriceBurns #4
Posted 16 July 2013 - 12:33 PM
Whats bad about disabling Disk Booting?
apemanzilla #5
Posted 16 July 2013 - 12:48 PM
If you make an error, or can't get the password right, you're in trouble.
Lyqyd #6
Posted 16 July 2013 - 01:17 PM
Without disk booting, it is possible to permanently and irrevocably brick computers. Disabling disk booting must be done server-wide, so any player that creates a program to permanently disable computers (which is very simple if disk booting is disabled) could make any computer on the server useless.
n1ghtk1ng #7
Posted 16 July 2013 - 07:59 PM
Don't disable disk booting, there's a much simpler way. Will respond when back home.
JackPriceBurns #8
Posted 17 July 2013 - 04:13 AM
But if i dont disable disk booting then people could just bypass the password lock door so what should i do to make it so that computer doesn't get bypassed that way also if you forget the password 3 times then you get kicked off for 1 minute and i think thats a good idea but i could add something like everytime you enter it wrong 3 times then also the time gets * by 2 or something
JackPriceBurns #9
Posted 17 July 2013 - 04:19 AM
I just change where the Lock terminal Feature is because i realized its only on the 4th time you enter a password it locks


os.pullEvent = os.pullEventRaw
x = 1
while true do
if x == 4 then
  print("Password Entered Incorrect 3 Times")
  print("Locked For 1 Minute")
  sleep(60)
  x = 1
end
term.clear()
term.setCursorPos(1,1)
write("Password: ")
local input = read("*")
if input == "password" then
  term.clear()
  term.setCursorPos(1,1)
  print("Password Correct")
  rs.setOutput("right",true)
  sleep(5)
  rs.setOutput("right",false)
else if input == "debug" then
  term.clear()
  term.setCursorPos(1,1)
  print("Entering Console Development Mode")
  error()
else
  print("Password Incorrect")
  x = x + 1
  sleep(2)
end
end
end

also if i set x = 0 at the start of the code then when it gets to the x = x + 1 it give a error saying something like error adding something to nil
albrat #10
Posted 17 July 2013 - 07:59 AM
For a neater debug exit… try printError() instead of print ()



if you place a disk drive under your computer … that is the priority device for loading … so place a disk drive under your computer and then place re-inforced stone around it, etc… that way the computer will only boot from your locking program.

There is also another security feature, nothing to do with your computer terminal… where is your door in relation to your computer terminal ? (I hope it is not to the right of your computer)

If it is to the right of your computer, try this… make a lever, place it infront of the door, flick the lever. Voila computer not needed.

I have a door system setup with the door placed in the Open position, always open. I then have a redstone torch underground that powers the door. The door then closes. I also have underground a server computer with wireless modem that has a "allowed" list of two computers. These two computers are the door terminals with wireless modems. The door terminals get a correct password and they send a message to the door controller, which then opens the door for 5 seconds.

(if you supply power to the side of a block with a redstone torch on top of it … it turns the torch off / opens the door)

breaking the computer means the door stays locked. dropping a Switch on the floor and turning it on, means the door is never going to open… voila locked untill the password is correct.

Sadly the fully working copy of my code is on a server i cannot access at the moment (ip changed and the admin guys are a bit busy to sort the server at the moment still on 1.4.7 minecraft. lol)
JackPriceBurns #11
Posted 17 July 2013 - 11:36 AM
Do you know anything else cool i can do with computer craft i mean the only think i think is cool is the lock door but thats like the only think i know a computercraft Computer can do
Lyqyd #12
Posted 17 July 2013 - 01:18 PM
The top of the computer is the first side it checks.
albrat #13
Posted 17 July 2013 - 02:57 PM
The top of the computer is the first side it checks.
eeps, I am still learning new things every day… lol Sorry about the mis-information on the bottom being the first side it checks. Thank you Lyqyd for correcting me. :)/>

As to the ideas as to what to use the computers for… a login system, server based login system, Door control system, access attempt logging systems, control machines that require redstone input. Detect redstone inputs, program mining turtles… A cobblestone generator!! (just made one myself from 2 turtles and a short program that loops untill inventory is full on a diamond chest.

just a few ideas about what to use the CC for.. (plus there are peripheral addons that add player detection etc… (the server i play on has none of those yet though).
H4X0RZ #14
Posted 17 July 2013 - 05:57 PM
@Disk booting
You could do it so.(It only saves the computer which is running this program):

local function ejectDisks()
  while true do
    for k,v in pairs(rs.getSides()) do
      disk.eject(v)
    end
  sleep(0)
  end
end

local function main()
--passwordScript here
end

parallel.waitForAny(ejectDisks, main)
ZagKalidor #15
Posted 17 July 2013 - 06:08 PM
Best way to hack a password protected door is to slam it down. Hehe - who needs computers if you got the ram…

I prefer Tesla-Coils - your dead while thinking of a passw……………..
you dont even need doors

You put industrialcraft tesla coils out of reach in range around your house. put a disc-drive in reach, if you enter the right disc (with the right name on it), you will be asked a password or a code, both data will be sent to a remote computer and verified, if correct - remote computer deactivates tesla.

B.t.w. I never played on servers, is there no way to dig in someones house behind the door? Bedrock can't be placed to build a house, so why do i need a password protected door if i can dig inside your house? Or is this a no-go? no clue!! Please inform me.
albrat #16
Posted 17 July 2013 - 08:10 PM
B.t.w. I never played on servers, is there no way to dig in someones house behind the door? Bedrock can't be placed to build a house, so why do i need a password protected door if i can dig inside your house? Or is this a no-go? no clue!! Please inform me.

I play on a server with 5 friends, we would not damage each others stuff… But I have been playing with the servers and clients on there. My base is erm. Modest in size, a floating castle from 72 blocks high at the base and extending to 130 ish high at the top I think, 64 x 64 base size. 1 big room where i do all my work, processing, storage and sorting of my quarries. A quad cobblestone generator. Recyclers, mass fabricators etc. We do not spawn items in. it's all hard work from nothing to where we are. ( nuclear reactors etc .. lol ) we all have Nukes… :P/>

My base is one of the smaller bases out of the 5 of us now. but I really can not be bothered to move to a new base / location. and it serves the needs of any base. (plenty of space)

Back to the question… Digging around the doors. First rule of security. Invest time and effort into making reinforced Stone, reinforced doors. (takes about 18 seconds of solid digging with a diamond pickaxe to remove) you can not remove them with anything other than a diamond pickaxe… not even tnt will not break them.

Where i build things that I do not want broken or accessed I build a little reinforced stone room… When I first setup a nuclear reactor… I was not sure about the destructive powers of it… so built a room with 3 reinforced blocks thick… I mistakenly got over zealous with the rods one day… 2x reinforced stone stops a nuclear explosion from a reactor. It left the outer shell of the room intact but irradiated everything around. lol.

one of the others on our server tested 4 "Nukes" and tried a reactor going critical. as a test on the reinforced stone… The 4 nukes were not as powerfull as the reactor going critical. So it just shows how strong the reinforced stone is… :)/>

Tesla coils are a bit too effective sometimes :P/> if you forget. ^_^/>
ZagKalidor #17
Posted 17 July 2013 - 08:32 PM
Back to the question… Digging around the doors. First rule of security. Invest time and effort into making reinforced Stone, reinforced doors. (takes about 18 seconds of solid digging with a diamond pickaxe to remove) you can not remove them with anything other than a diamond pickaxe… not even tnt will not break them.

Ok, first of all, thankx for that reply, that is totaly off topic, i know that, but it's simply a question that is in my mind, since i use computercraft and CCsensors and stuff. Of course i made my own security system doors and because of that i always reasked the final need of that all, to come back to the question that is in my mind.

Why the hell should i programm a security door, that can be broken and easily entered? And coming back to your sense that i quoted above. Nevertheless it takes 18 seconds to break one block of reinforced stone. The thought behind for me is simply, - it can be broken - end. Nothing more and nothing less. See what i mean? Why build an expensive wall, when i can walk around it. Ok some people take their first steps in coding, doing such stuff, it was the same with me. But for me, the core sense is that a door can not be protected in our known ways. The only thing that would be save, would be a bedrock-piston door, but this is not existing.

Tesla coils are a bit too effective sometimes :P/> if you forget. ^_^/>

Yeah, they are indeed, got killed by my own a several times, but for sure, this makes it that interesting. But honestly, if a person is really behind breaking into your house, he could nuke several layers of reinforced stone, until he sees the coils, and then nuke them too, but maybee there will be no house left in that scenario to break into.

My backthought is just, my home is never quite safe.
albrat #18
Posted 17 July 2013 - 08:56 PM
In the case of my castle… one nuke would remove it. lol. But it would also kill the server. Item drops from chests…
Lyqyd #19
Posted 17 July 2013 - 08:56 PM
Other mods do add possibilities that make locking programs actually meaningful, like MFFS. There are also block protection plugins and the like, though those can usually be defeated by turtles if turtles are enabled at all.
albrat #20
Posted 18 July 2013 - 06:20 AM
Client for my server

http://pastebin.com/Y77DKddS

Server for my Client

http://pastebin.com/JiQFgstb

Basically save them as "server" and "client" then call them by writing a startup file with "shell.run("server")" or "shell.run("client")" that way you can tell what you installed where.

there is a server thing you have to change. the admin in the users … you can either remove the admin from the users or change the password. (currently "23super" ) so no users can disable the server. ** I wrote a back door into the server so an admin can shut down the CTRL + T terminate incase of maintenance. This means you can add more users by stopping the server and editing the users table. ** hence I say change the admin password as soon as you install it. (as a secondary security feature, choose a admin pc, get it's id number and change the adminid to that pc's number - only a adminid can disable the server's anti terminate)
Sheefou #21
Posted 04 August 2013 - 06:08 PM
i kinda need some help with my script on my door i got it to boot but it keeps booting over and over again and im sick of it

os.pullEvent = os.pullEventRaw
local adminpw = "admin"
local side = "left"
local password = "creeper"
local opentime = 5
while true do
term.clear()
term.setCursorPos(1,1)
write("Access Code Or Admin")
local input = ("*")
if input == password then
  term.clear()
  term.setCursorPOS(1,1)
  textutils.slowPrint("Access Granted")
  rs.setOutput(side,true)
  sleep(opentime)
  rs.setOutput(side,false)
else
  term.clear()
  term.setCursorPos(1,1)
  textutils.slowPrint("Access Denied Activating Alarm Systems!")
  textutils.slowPrint("System Timeout Retry in 60 seconds")
  sleep(60)
  os.reboot
if input == adminpw then
os.pullEvent = pullEvent
end
end
it keeps booting over and over again i need some help please
ZagKalidor #22
Posted 05 August 2013 - 03:16 AM
You assign the variable input to be ("*"). So when it comes to the check for input, the condition is always not the password and then, of course, runs the reboot. The statement should be like:

Local input = read("*")

You just forgot to put the read command to it. Without it, its just a variable assignment.

Also check the line after the term.clear()
You write term.setCorsorPOS. It has to be setCursorPos
Sheefou #23
Posted 05 August 2013 - 10:44 AM
ohh thxs but i put it in the programmin when i relized my mistake and i still keep getting the same problem
TyDoesMC #24
Posted 05 August 2013 - 06:02 PM
Here Is My Type Of Lock!


--[[ Password Lock ]]--
--[[ Code ]]--
correctpass = "Password"
input = read()
write("Password: ")
if input == (correctpass) then
print("Correct!")
rs.setOutput("side", true)
sleep(4)
rs.setOutput("side", false)
else
print("Incorrect!")
print("Shutting Down!")
sleep(1)
os.shutdown()
end
Sheefou #25
Posted 05 August 2013 - 06:41 PM
yeah but my version keeps ppl from terminating the program so i can use the admin pw to bypass the program and edit the lock when ever i want to so there for this lock is the best way to keep people out while still having access to the command lines :)/>

also does anyone know how to access a computer via a cabled computer
Kingdaro #26
Posted 05 August 2013 - 06:45 PM
also does anyone know how to access a computer via a cabled computer
Through wired modem cables? You should read up on this: http://www.computercraft.info/forums2/index.php?/topic/11244-151-using-network-cables-for-dummies/#peripherals