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

Ultimate Door Lock - PDA Opened Doors!

Started by oeed, 22 March 2014 - 10:05 AM
oeed #1
Posted 22 March 2014 - 11:05 AM
Now, you may be thinking, "oeed, why are you of all people making a door lock - something normally made by first-time users." Well, the answer is quite simple really, Pocket Computers now have wireless modems. This means door locks without having to actually do anything :D/> So, I after noticing that Dan added modems I jumped straight in and started working on it earlier today and it's turned out pretty nice. There's only one file, it detects whether the computer is a pocket computer and runs the appropriate system.

ScreenshotsThe settings page (door computer)


The normal door computer screen


The Pocket Computer screen.

Installation
Obviously, you'll need the latest 1.6 pre-release, so make sure you install that first.

Then, on the computer that attaches to the door/redstone wire run:

pastebin get 4QeAEiTM startup

Attach a wireless modem to any side of the computer, then just reboot.

To register a pocket computer all you need to do is attach a disk drive to the computer then pop an advanced wireless pocket computer in to the slot. It will automatically install the software and set it up.

More Info
As more 1.6 features are released I'll add try to add them, beeping and vibrating are rumoured, so I'll probably add those.
In the next release of OneOS this will be integrated in to the OS. If you have OneOS running on your PDA you can use it as a door key without having to keep any program running, it will happen in the background.

This has probably still got a few bugs here and there, if you find any or have a suggestion let me know!
Edited on 22 April 2014 - 07:11 AM
TheOddByte #2
Posted 22 March 2014 - 11:13 AM
Wow this seems pretty cool, Now I just need to download the 1.6 pre-release and test this! :D/>
oeed #3
Posted 22 March 2014 - 09:32 PM
Fixed a blindingly obvious bug where the redstone signal would only come out the bottom.
GravityScore #4
Posted 23 March 2014 - 02:15 PM
Been a while since I clicked on a link to a door lock program! :P/> Great job, looks awesome. Time to test it out.
awsmazinggenius #5
Posted 23 March 2014 - 06:39 PM
What if you are killed in PvP, and someone grabs your PDA when you drop your stuff? Also, does this require advanced computers? (I only took a tiny look at the source). If so, you should port it to normal computers (press r to register a PDA, for example) because those are cheaper to craft.

Also, about the PDA death issue, if you choose to use an RFID or Mag-Strip card to log on (I ditched awsmazingOS before the PDAs, even the ones with no modems, and if you use terminal glasses, your username can be checked), awsmazingOS will occasionally ask you for a password to ensure security. I recommend you implement something similar, as well as require a password to register/delete PDAs, as there are people that don't know any better than to put the computer right next to their door like a normal door lock.
oeed #6
Posted 23 March 2014 - 08:51 PM
What if you are killed in PvP, and someone grabs your PDA when you drop your stuff? Also, does this require advanced computers? (I only took a tiny look at the source). If so, you should port it to normal computers (press r to register a PDA, for example) because those are cheaper to craft.

Also, about the PDA death issue, if you choose to use an RFID or Mag-Strip card to log on (I ditched awsmazingOS before the PDAs, even the ones with no modems, and if you use terminal glasses, your username can be checked), awsmazingOS will occasionally ask you for a password to ensure security. I recommend you implement something similar, as well as require a password to register/delete PDAs, as there are people that don't know any better than to put the computer right next to their door like a normal door lock.
As there's no way to detect if it switches owner you'd have to unregister all of the PDAs then make a new one.
I do agree that a non advanced option should be available, I'll try to get that done this week, at the very least the PDA version will not require colour. The problem with the door computer is that it will probably need quite a bit of recoding to work on a black and white screen.

I'll think about the password. It just adds a level of confusion, that's all.
awsmazinggenius #7
Posted 24 March 2014 - 06:05 AM
Also, when you add a new PDA, it would be nice if you could give it a name for the list, so that you could delete individual PDA's. Say if. I got killed and dropped my tablet, then another friend on the server could delete my PDA while keeping everyone else's intact.
oeed #8
Posted 24 March 2014 - 07:02 AM
Also, when you add a new PDA, it would be nice if you could give it a name for the list, so that you could delete individual PDA's. Say if. I got killed and dropped my tablet, then another friend on the server could delete my PDA while keeping everyone else's intact.

I see what you mean. How would you name them though? I'll think about it.
CometWolf #9
Posted 24 March 2014 - 08:26 AM
Logically you would name it the same as your username :P/>
oeed #10
Posted 24 March 2014 - 08:36 AM
Logically you would name it the same as your username :P/>
It just makes the setup process harder really, if I find a public 1.6 server I'll try it out there and see if there's a need.

Update 1 Released

This update adds support for non-advanced computers. Both PDAs and computers will work with out colour screens. This is the first time I've actually made a non-advanced computer GUI, so it's been a bit of an experiment to get it working at an acceptable level of usability. The key in square brackets is they key you press to click the button.


There may be a few bugs related to this, if you do find anything let me know.
apemanzilla #11
Posted 24 March 2014 - 01:03 PM
I feel like the "opening distance" settings should be Close, Normal, and Far instead of Small, Normal, and Far. Might just be me :P/>
awsmazinggenius #12
Posted 24 March 2014 - 04:27 PM
I feel like the "opening distance" settings should be Close, Normal, and Far instead of Small, Normal, and Far. Might just be me :P/>

I think that technically both are proper grammar, so really you could use either, unless there is something that I am missing.
"A small distance from here."
"Close to here."
oeed #13
Posted 24 March 2014 - 08:47 PM
I feel like the "opening distance" settings should be Close, Normal, and Far instead of Small, Normal, and Far. Might just be me :P/>

I did actually have close to start with, but I decided to change it to small due the the possibility of confusion with close as in close the program. Might be going a bit too far there, however.
awsmazinggenius #14
Posted 24 March 2014 - 11:57 PM
How about "Short"? If Apemanzilla wants a change, that should please him, and it doesn't cause confusion, either.
Lego Stax #15
Posted 25 March 2014 - 03:13 AM
This is the first time that I have EVER clicked on a door opening program. It looks very useful, especially with a large piston door. I like the GUI and the fact that it's easy to use for anyone. I just HAVE to check this out!
oeed #16
Posted 25 March 2014 - 03:29 AM
This is the first time that I have EVER clicked on a door opening program. It looks very useful, especially with a large piston door. I like the GUI and the fact that it's easy to use for anyone. I just HAVE to check this out!

Thanks!
Lego Stax #17
Posted 25 March 2014 - 01:49 PM
This is the first time that I have EVER clicked on a door opening program. It looks very useful, especially with a large piston door. I like the GUI and the fact that it's easy to use for anyone. I just HAVE to check this out!

Thanks!
You're welcome. I was looking through your code (I'm not even close to a pro at Lua), and I was wondering, how do you actually send messages with the pocket computer? What I think that I'm seeing in there is interfacing with the modem using the modem API. Is there any other way to do this? And if this is the only way, how exactly would I use it? Please pardon me for being a very dumb coder.
Edited on 25 March 2014 - 12:49 PM
Csstform #18
Posted 25 March 2014 - 06:00 PM
Vibration!!!

Im currently envisioning 2 players reading some signs, when one starts jiggling…. the other is like: "Dude, too much sugar?" Meanwhile, the first guy is like, "My screen is shaking so much, I cant find my dang PC!!"

Or, you are just chatting on skype, when *ding*. What the heck was that!!!!
oeed #19
Posted 25 March 2014 - 09:01 PM
This is the first time that I have EVER clicked on a door opening program. It looks very useful, especially with a large piston door. I like the GUI and the fact that it's easy to use for anyone. I just HAVE to check this out!

Thanks!
You're welcome. I was looking through your code (I'm not even close to a pro at Lua), and I was wondering, how do you actually send messages with the pocket computer? What I think that I'm seeing in there is interfacing with the modem using the modem API. Is there any other way to do this? And if this is the only way, how exactly would I use it? Please pardon me for being a very dumb coder.
I copied out the Wireless and Peripheral APIs out of OneOS, they just make everything a lot more simple. Basically, the door computer sends out a message containing 'Ping!'. Every PDA running the program in range will then send back their 'fingerprint', a random string generated when the first turn the program on or register it. If the door computer has that finger print on file and the PDA is within the set distance it will open the door. I may be taking a too simplified approach in my explanation, as it's not really about the code but more how it work, but let me know if you want more clarification.

Vibration!!!

Im currently envisioning 2 players reading some signs, when one starts jiggling…. the other is like: "Dude, too much sugar?" Meanwhile, the first guy is like, "My screen is shaking so much, I cant find my dang PC!!"

Or, you are just chatting on skype, when *ding*. What the heck was that!!!!
I know Dan was planning to add pocket.vibrate and pocket.beep (or something along those lines), has he done that yet or is it still a maybe?
Lego Stax #20
Posted 25 March 2014 - 11:48 PM
-snip-
Yeah, I'm sorry, I guess I still don't understand exactly how you do it. Are you interfacing with the wireless modem directly? Is there any easier way to do this? I know that I tried using Rednet, as I thought that it would work, to no avail. Should I use the peripheral API instead and interface directly? Perhaps the modem API? Thank you SOOOO much for your help. You are literally the only person helpful! I've found no documentation anywhere regarding pocket computers except for in your programs. Did some more digging in your Wireless 'class' and I figured it out. Thank you SOOOOO much for your help! It is much appreciated.

oeed said:
I know Dan was planning to add pocket.vibrate and pocket.beep (or something along those lines), has he done that yet or is it still a maybe?
On his Twitter, he stated that he liked the idea, although I tried it in the most recent update, pr7, it does not work. I don't know if he's going to put it in either.
Edited on 25 March 2014 - 10:55 PM
oeed #21
Posted 26 March 2014 - 12:16 AM
-snip-
Yeah, I'm sorry, I guess I still don't understand exactly how you do it. Are you interfacing with the wireless modem directly? Is there any easier way to do this? I know that I tried using Rednet, as I thought that it would work, to no avail. Should I use the peripheral API instead and interface directly? Perhaps the modem API? Thank you SOOOO much for your help. You are literally the only person helpful! I've found no documentation anywhere regarding pocket computers except for in your programs. Did some more digging in your Wireless 'class' and I figured it out. Thank you SOOOOO much for your help! It is much appreciated.

oeed said:
I know Dan was planning to add pocket.vibrate and pocket.beep (or something along those lines), has he done that yet or is it still a maybe?
On his Twitter, he stated that he liked the idea, although I tried it in the most recent update, pr7, it does not work. I don't know if he's going to put it in either.

You're most welcome :D/>

I'm pretty sure he mentioned it after he released pr7, so with luck it'll be in pr8.
Lego Stax #22
Posted 26 March 2014 - 12:17 AM
Ah, ok. I didn't know that. Looking forward to the new update!
theoriginalbit #23
Posted 27 March 2014 - 11:58 PM
So congrats on being the first program in "Pocket Programs" :)/>
oeed #24
Posted 28 March 2014 - 01:56 AM
So congrats on being the first program in "Pocket Programs" :)/>

Ooooo, didn't notice that :D/>
apemanzilla #25
Posted 28 March 2014 - 12:11 PM
Woot for a new category :D/>
Vexatos #26
Posted 28 March 2014 - 05:01 PM
This is literally the very first thing anyone would want when thinking about Pocket Computers a.k.a PDAs. Good job!
awsmazinggenius #27
Posted 29 March 2014 - 03:48 PM
If you have OneOS running on your PDA
Try running OneOS on a PDA. It doesn't work as expected, as the desktop is cut off, some things like the "Pick your color" are cut off, etc.
Lyqyd #28
Posted 29 March 2014 - 09:28 PM
I added a feature to pocketgps to enable compatibility with this program. It works pretty flawlessly, but I noticed that your program sometimes doesn't like packets that come in as tables. You may want to add some additional type checking to disallow other rednet traffic from screwing up the system. Also, just wanted to let you know that you can send tables as tables in more recent versions of ComputerCraft, including 1.6.
oeed #29
Posted 29 March 2014 - 10:13 PM
I added a feature to pocketgps to enable compatibility with this program. It works pretty flawlessly, but I noticed that your program sometimes doesn't like packets that come in as tables. You may want to add some additional type checking to disallow other rednet traffic from screwing up the system. Also, just wanted to let you know that you can send tables as tables in more recent versions of ComputerCraft, including 1.6.

Ok, I'll do some experimenting with the two, thanks.
tycoonlover1359 #30
Posted 30 March 2014 - 03:07 PM
This program looks awesome! I will definitely be playing with this when I get a chance. Thanks for doing this kind of program. I really wanted to make my own but I found it harder than I thought. Thanks for this program once again, (and as BeBopVox would say) Diamonds to you!
Sxw #31
Posted 31 March 2014 - 01:03 AM
Is there anything keeping others from rebroadcasting the fingerprint to open the door?
oeed #32
Posted 31 March 2014 - 03:51 AM
Is there anything keeping others from rebroadcasting the fingerprint to open the door?

No. There's really nothing I can think of that can prevent others from mimicking another PDA. ComputerCraft is very open, even if I did encrypt everything you could still fairly easily reverse it.

If you have any suggestions let me know. I'm trying out the program on the CoderCraft server and haven't run in to any issues as of yet.
Graypup #33
Posted 31 March 2014 - 04:43 AM
Is there anything keeping others from rebroadcasting the fingerprint to open the door?

No. There's really nothing I can think of that can prevent others from mimicking another PDA. ComputerCraft is very open, even if I did encrypt everything you could still fairly easily reverse it.

If you have any suggestions let me know. I'm trying out the program on the CoderCraft server and haven't run in to any issues as of yet.
Simple. Shared secret. Server sends a challenge (RANDOM), server encrypts it, without sending the encrypted version, client encrypts it, server checks whether it's the same as its own encryption. Just grab some lua implementation of a cipher, and add the 10 lines of code necessary
amtra5 #34
Posted 31 March 2014 - 05:57 AM
Is there anything keeping others from rebroadcasting the fingerprint to open the door?

No. There's really nothing I can think of that can prevent others from mimicking another PDA. ComputerCraft is very open, even if I did encrypt everything you could still fairly easily reverse it.

If you have any suggestions let me know. I'm trying out the program on the CoderCraft server and haven't run in to any issues as of yet.
Simple. Shared secret. Server sends a challenge (RANDOM), server encrypts it, without sending the encrypted version, client encrypts it, server checks whether it's the same as its own encryption. Just grab some lua implementation of a cipher, and add the 10 lines of code necessary
The shared key would have to be distributed beforehand in the program, where it could be easily copied from
oeed #35
Posted 31 March 2014 - 07:56 AM
–snip–

Simple. Shared secret. Server sends a challenge (RANDOM), server encrypts it, without sending the encrypted version, client encrypts it, server checks whether it's the same as its own encryption. Just grab some lua implementation of a cipher, and add the 10 lines of code necessary
The shared key would have to be distributed beforehand in the program, where it could be easily copied from

Exactly, nothing you can do in CC is secure. I have taken reasonable precautions to prevent people breaking in, however.

Even if you entered a password specific to that server, you could just copied the message the PDA sent and send that.
6677 #36
Posted 31 March 2014 - 11:59 AM
even on short range, just run in with the person opening the door :P/>
SuicidalSTDz #37
Posted 31 March 2014 - 12:34 PM
even on short range, just run in with the person opening the door :P/>
The person opening the door should look around first, if they were smart.

Anyway, nice job oeed. You never dissapoint :P/>
oeed #38
Posted 31 March 2014 - 09:39 PM
even on short range, just run in with the person opening the door :P/>

What I could do it track the PDA and see if they're approaching the door. If they start moving away I could close it again.
awsmazinggenius #39
Posted 01 April 2014 - 02:26 AM
How about a shared secret that gets shared when the PDA is first inserted into the drive to sync it. Would that work? I haven't looked at PDAs in drives much yet.
Dirt Diver #40
Posted 01 April 2014 - 03:05 AM
i really like this code gj
oeed #41
Posted 01 April 2014 - 03:21 AM
How about a shared secret that gets shared when the PDA is first inserted into the drive to sync it. Would that work? I haven't looked at PDAs in drives much yet.

But the issue is, if you can record the message the PDA sent you can easily mimic it.
apemanzilla #42
Posted 01 April 2014 - 03:40 AM
How about this:

Insert PDA into drive connected to door lock computer. Enter PDA ID into computer. Computer then generates a key file and stores it on the PDA along with the door opener program. The key stored on the PDA is used to generate a hash that changes each time a new one is generated. Eg:
PDA and lock both have a record of the key and a record of how many times that key has been used. Every time the door is opened, the PDA generates a hash based on the key and number of usages, then sends it to the lock. The lock generates a hash with the same parameters, checks if they're equal and confirms it with the client. The amount of usages is then incremented by one on both devices so the next hash is different and the prior one is invalid.

That's about as safe as you could get with CC rednet.
MaHuJa #43
Posted 01 April 2014 - 04:15 AM
Simple. Shared secret. Server sends a challenge (RANDOM), server encrypts it, without sending the encrypted version, client encrypts it, server checks whether it's the same as its own encryption. Just grab some lua implementation of a cipher, and add the 10 lines of code necessary

Even if you entered a password specific to that server, you could just copied the message the PDA sent and send that.
But the issue is, if you can record the message the PDA sent you can easily mimic it.

That you miss it even after graypup hands you the solution on a silver platter, is slightly worrisome.
Did you just give up prematurely?

You talk about CC being "open" - but it is perhaps less so than the computers and networks outside of minecraft.
Even then "playback attacks" are a solved problem. We know the solutions. They apply just as well in CC.

I discovered this in the code:
for _ = 1, 256 do
local char = math.random(32, 126)
–if char == 96 then char = math.random(32, 95) end
str = str .. string.char(char)
end
Look up table.concat and why it exists.

How about this:

That'll work very well until they get out of sync. More naive implementations can even be tricked into desyncing deliberately (denial of service), and keeping them in sync requires two-way communication, at which point a challenge-response is probably a better solution anyway. The use of a increment rather than random data is better wrt birthday attacks, since foreknowledge of the data helps the attacker little.
Edited on 01 April 2014 - 03:48 AM
oeed #44
Posted 01 April 2014 - 06:32 AM
How about this:

Insert PDA into drive connected to door lock computer. Enter PDA ID into computer. Computer then generates a key file and stores it on the PDA along with the door opener program. The key stored on the PDA is used to generate a hash that changes each time a new one is generated. Eg:
PDA and lock both have a record of the key and a record of how many times that key has been used. Every time the door is opened, the PDA generates a hash based on the key and number of usages, then sends it to the lock. The lock generates a hash with the same parameters, checks if they're equal and confirms it with the client. The amount of usages is then incremented by one on both devices so the next hash is different and the prior one is invalid.

That's about as safe as you could get with CC rednet.
Hmmm, I'll think over it on my way home.

Simple. Shared secret. Server sends a challenge (RANDOM), server encrypts it, without sending the encrypted version, client encrypts it, server checks whether it's the same as its own encryption. Just grab some lua implementation of a cipher, and add the 10 lines of code necessary

Even if you entered a password specific to that server, you could just copied the message the PDA sent and send that.
But the issue is, if you can record the message the PDA sent you can easily mimic it.

That you miss it even after graypup hands you the solution on a silver platter, is slightly worrisome.
Did you just give up prematurely?

You talk about CC being "open" - but it is perhaps less so than the computers and networks outside of minecraft.
Even then "playback attacks" are a solved problem. We know the solutions. They apply just as well in CC.

I discovered this in the code:
for _ = 1, 256 do
local char = math.random(32, 126)
–if char == 96 then char = math.random(32, 95) end
str = str .. string.char(char)
end
Look up table.concat and why it exists.

Hmm, I must've misread that. I'll see if I can get it working.
McDonald072 #45
Posted 01 April 2014 - 03:41 PM
How does this work? Does the PDA send "open the door" to the computer? If so, how do you limit the range of the modems?
SuicidalSTDz #46
Posted 01 April 2014 - 05:08 PM
Also, just wanted to let you know that you can send tables as tables in more recent versions of ComputerCraft, including 1.6.
Did Dan forget to put this in the changelog? I knew people were talking about it a while ago in the IRC channel but I didn't see it documented anywhere.
6677 #47
Posted 01 April 2014 - 05:43 PM
Also, just wanted to let you know that you can send tables as tables in more recent versions of ComputerCraft, including 1.6.
Did Dan forget to put this in the changelog? I knew people were talking about it a while ago in the IRC channel but I didn't see it documented anywhere.
I noticed that some rednet messages arrive as tables when received using the modem API so that also seems to be an undocumented feature.
oeed #48
Posted 01 April 2014 - 09:57 PM
How does this work? Does the PDA send "open the door" to the computer? If so, how do you limit the range of the modems?

Essentially, the door 'host' computer sends out a ping message every half a second (or about that). Upon recieveing one of these messages it then send the PDA's fingerprint back to the host computer. If the host computer has that fingerprint on file and is close enough it will open the door. The modem message event also contains the distance that the message travelled, so this way it's pretty easy to limit the distance.

I'm currently planning to change the authentication method using the one above, however, to make it more secure.
Lyqyd #49
Posted 02 April 2014 - 01:44 AM
I'm currently planning to change the authentication method using the one above, however, to make it more secure.

I was really hoping to not see you say this. Oh well, it was nice to include support in pocketgps while I could.
oeed #50
Posted 02 April 2014 - 01:57 AM
I'm currently planning to change the authentication method using the one above, however, to make it more secure.

I was really hoping to not see you say this. Oh well, it was nice to include support in pocketgps while I could.
I would like to support pocketgps if possible, what would the issue be with changing to a more secure system? If possible I would like to make it compatible with everything. What are the issues involved?
Lyqyd #51
Posted 02 April 2014 - 02:16 AM
Well, I suppose the problem is more philosophical than technical. I don't think that adding further "security" is going to have any benefit beyond the fingerprint system already in place. We're talking about setting up complex, resource-intensive cryptography systems for a Minecraft door lock. These are not usually operations that are cheap to perform, time-wise. Sure, it's possible to create a more secure system, but on many servers, the other person could also just walk in and break your door. So, with the ease of access in the physical minecraft world and the difficulty/time cost of cryptographic security in ComputerCraft, I've always felt that it simply isn't worth it to include much security in applications. PocketGPS currently supports the door lock compatibility with 18 lines of code, and I have the feeling that that would balloon tremendously if a cryptographic security scheme was added.
oeed #52
Posted 02 April 2014 - 02:51 AM
Well, I suppose the problem is more philosophical than technical. I don't think that adding further "security" is going to have any benefit beyond the fingerprint system already in place. We're talking about setting up complex, resource-intensive cryptography systems for a Minecraft door lock. These are not usually operations that are cheap to perform, time-wise. Sure, it's possible to create a more secure system, but on many servers, the other person could also just walk in and break your door. So, with the ease of access in the physical minecraft world and the difficulty/time cost of cryptographic security in ComputerCraft, I've always felt that it simply isn't worth it to include much security in applications. PocketGPS currently supports the door lock compatibility with 18 lines of code, and I have the feeling that that would balloon tremendously if a cryptographic security scheme was added.

I do agree with you completely, I'm commonly stating that security in ComputerCraft is virtually worthless, it's more the fact that people are worried about it. I'll take a look at the PocketGPS code and see issues are involved.

Edit: Oh, I see, you've added a function that essentially works as the pocket computer program. I was thinking that it was interfering with modem messages or something. In that case I'll leave it as it is. The disadvantages outweigh the advantages.
Edited on 02 April 2014 - 12:57 AM
Lyqyd #53
Posted 02 April 2014 - 03:30 AM
I do agree with you completely, I'm commonly stating that security in ComputerCraft is virtually worthless, it's more the fact that people are worried about it. I'll take a look at the PocketGPS code and see issues are involved.

Edit: Oh, I see, you've added a function that essentially works as the pocket computer program. I was thinking that it was interfering with modem messages or something. In that case I'll leave it as it is. The disadvantages outweigh the advantages.

Awesome, that's great news. I had been watching the topic with some trepidation as additional security was discussed!

Also, I'm very glad that you (intentionally or not) designed the put-the-pocket-computer-in-the-disk-drive whitelisting to not interfere with the contents of the pocket computer if it already has a fingerprint file, regardless of what else may be on the pocket computer, as that is much better for compatibility with other software! :)/>
apemanzilla #54
Posted 02 April 2014 - 01:11 PM
@oeed, you could provide an API for the door lock :P/>
oeed #55
Posted 02 April 2014 - 09:55 PM
@oeed, you could provide an API for the door lock :P/>

Actually that's not a bad idea. I'll start it this afternoon.
MaHuJa #56
Posted 04 April 2014 - 04:20 AM
We're talking about setting up complex, resource-intensive cryptography systems for a Minecraft door lock.
Which is a great stepping stone for learning how to think security outside of minecraft.
When you learn a craft, like playing some instrument or carpentry, you usually start with the trivial stuff that nobody cares so much about, right? Security should be similar.

These are not usually operations that are cheap to perform, time-wise.
Especially since we have to use lua implementations of these algorithms, rather than a binding to java runtime which typically call upon native functions. This deficiency makes it magnitudes worse.

"ease of access in the physical minecraft world"
There are several mods that allow you to avoid this problem, and some of us do play with them. MFFS is perhaps the most famous.
In particular I wish to highlight servers where visitors are in adventure mode.

"difficulty/time cost of cryptographic security in ComputerCraft"
If we had the function calls to do it a couple magnitudes more cheaply…

"simply isn't worth it"
… would perhaps change.
But for a server with the current CC being the only mod, I completely agree.

… door lock compatibility with 18 lines of code … balloon tremendously …
Or it could be shrunk to even less if the code in question was usable as an API.
oeed #57
Posted 04 April 2014 - 05:33 AM
–snip–

I am considering making an API for the program Apemanzilla mentioned which would allow me to add encryption really easily. Lyqyd how easy/difficult would it be to switch PocketGPS to this API, allowing for encryption?
Lyqyd #58
Posted 04 April 2014 - 05:43 AM
Shouldn't be too hard.

If you do go with a separate API, it would probably be best to have it copied over to the PDA when a new fingerprint is added, and ensure that the presence (or lack thereof) of that API is the only thing that it checks to decide whether to copy it over or not. That way, if someone is using pgps and generates a fingerprint file, when they add the PDA to the lock's whitelist, it can be given the API file. I'll have my code check for the API file and use it if present, otherwise use the existing code. Then it won't matter what you do in the API as long as you don't change the API calls.
Sxw #59
Posted 13 April 2014 - 05:31 PM
Someone could setup a modem repeater near the pocket computer to make the door seem closer than it really is.
Wojbie #60
Posted 13 April 2014 - 06:39 PM
@Sxw - he is using modem api not rednet api - repeater would not pass message on.
6677 #61
Posted 14 April 2014 - 07:33 PM
@Sxw - he is using modem api not rednet api - repeater would not pass message on.
one could easily be built operating on the modem API
awsmazinggenius #62
Posted 15 April 2014 - 03:24 AM
You can still repeat modem messages by writing your own code.

Edit: damn ninja
Edited on 15 April 2014 - 12:32 PM
Wojbie #63
Posted 15 April 2014 - 11:26 AM
True :P/> Did not think of that. Wonder how annoying would it be if someone walked around with such repeater on theirs PocketC.
Blue #64
Posted 15 April 2014 - 04:45 PM
first hot topic on the pocket programs section :o/>
apemanzilla #65
Posted 15 April 2014 - 04:49 PM
And it's a door lock :o/>
CastleMan2000 #66
Posted 26 April 2014 - 09:13 PM
Could you also make the program compatible with regular wireless pocomps? I don't have any advanced ones :/
oeed #67
Posted 27 April 2014 - 12:28 AM
Could you also make the program compatible with regular wireless pocomps? I don't have any advanced ones :/
Yea it does work with regular computers.
CastleMan2000 #68
Posted 27 April 2014 - 06:29 PM
I tried it and it didn't seem to :/
oeed #69
Posted 28 April 2014 - 12:19 AM
I tried it and it didn't seem to :/

Hmm, what specifically didn't work?
aoi222 #70
Posted 28 April 2014 - 02:41 PM
First off, love the program, keep up the great work.

I had a couple suggestions that I noticed while playing around with the program.

1) The program doesn't play nice with external monitors unless you make them 5x3 or larger. It would be awesome if it could scale the GUI a bit based on the size of the monitor. Alternatively, direct support for an external monitor that just displays status information could be useful as well.

2) If you have a wired modem connected, which is again useful for connecting external monitors, there can be issues with the program not finding the wireless modem (depending on which side it is attached to).

3) This ties in a bit with the encryption discussion. For those of us who are running a private server with just friends it would be nice to have a few different configurations for keys. The first would be "OPEN" so that anyone with a pPC running the lock program can open the door without needing to syncing with the host computer first. The second would be "LOCKED", which only opens a pPC that has been synced with the host Computer (how it currently operates). The third would be "SECURE", which would work the same as "LOCKED", but more secured against replay attacks. The easiest way I can see to do "SECURE" would be to have the server broadcast a challenge number, have the pPC run that number through some key function to generate a new number, encrypt it with the hosts public key, then send back the response to the host. As long as the host changes the challenge number each time prevent a replay attack.
CastleMan2000 #71
Posted 29 April 2014 - 02:38 AM
(I'll test the lock again sometime, btw)
That's actually a good idea. Like, each key PDA has a function/number or whatever that is unique to it, and then when it receives the challenge number, runs it through that, and sends it back to the server, which has used the same function/number?
Sxw #72
Posted 20 June 2014 - 03:38 AM
Security with this is pretty futile unless you listen for duplicated messages. Which could be done… Just see if the first (correct) message is in the right range.
oeed #73
Posted 17 July 2014 - 07:16 AM
I've uploaded a small update.

While testing OneOS 1.2 I noticed that there was an issue with the Peripheral API I was using in which it mightn't detect the wireless modem. Let me know if you run in to any issues.
SovietRussianSpy #74
Posted 20 July 2014 - 09:42 PM
This pastebin is telling me No such program… It was working and then it stopped.
oeed #75
Posted 20 July 2014 - 11:22 PM
This pastebin is telling me No such program… It was working and then it stopped.
Can you be more descriptive? The Pastebin appears to be fine, so it might be a bug in the code.
Tombot44 #76
Posted 22 July 2014 - 10:04 AM
Maybe make something that you can attach a monitor to the door opening computer and it show the status of the door, and maybe even something on the monitor for a second redstone output with the name Lights so we could have lights and door status.
oeed #77
Posted 22 July 2014 - 10:53 PM
Maybe make something that you can attach a monitor to the door opening computer and it show the status of the door, and maybe even something on the monitor for a second redstone output with the name Lights so we could have lights and door status.
Quite a good idea, if I find the time I might add that.
hbomb79 #78
Posted 29 July 2014 - 06:44 AM
I love this, As a matter of fact im trying to figure out how to do it myself… I wanted to add it into my security suite, Although your coding is difficult for me to figure out…. I guess ill just have to guess as yours is the only one.. :)/> Very well done though, i love using it
RlonRyan #79
Posted 14 August 2014 - 07:26 PM
I hope you don't mind if I add this to my computer setup suite. Of course all credit will be given to you for the program. I will not post a link to my suite as I am not attempting to advertise it, rather merely expand it with an excellent program such as yours.

Thanks,
Rlonryan
tjwmagic #80
Posted 20 September 2014 - 10:34 PM
For the redstone distance, how many blocks is the small, normal, and far? My reason is because I have the AE room and my IC2 Room on the same PDA, but AE has a shorter distance before it will open, unlike IC2 room where it opens far away but some times it will not open at all.

Attached is a picture of a computer above a red lamp and under the lamp is a door. I connected the computer and the PDA and it shows that it works. Behiend it, you can't see in the picture is another computer and door. But it will open.

This link will send you to a dropbox folder, with the files for the computer. There are 2 computers, one for the AE room, which is working, and the other for the IC2 room, which is not working. They are both set to bottom. Folder 4 is the AE room and 5 is the IC2. There are going to be a lot more of thees doors and I just want to only have 1 PDA for every door that I have.
SimonT456 #81
Posted 29 October 2014 - 08:50 PM
This works great, i don't have any trouble with it.
DoomRater #82
Posted 09 November 2014 - 08:32 PM
Dang, I was hoping there'd be an easy fix to figure out in what direction a message came from, but all the API returns is a distance, which would require at least another computer on the same plane as the plane I want to exclude from having access in order to for example only open a door on floor 1 but not have it open from floor 2 where the computer actually is. Oh well, there are more manual ways to solve this problem including ANDing some secret door input method on top of being close enough.
ninja4523 #83
Posted 22 November 2014 - 12:50 AM
This is a nice program but it would be nice if there was an option to choose whether or not you want doors to open when you get close to them. Also if you made an option to use the PDA as a limited access system that allows users to only access certain areas of the owner's base then that would be very cool.
oeed #84
Posted 22 November 2014 - 06:53 AM
This is a nice program but it would be nice if there was an option to choose whether or not you want doors to open when you get close to them. Also if you made an option to use the PDA as a limited access system that allows users to only access certain areas of the owner's base then that would be very cool.

I might be misunderstanding you, but I'm pretty sure you can do both already.

With your first point, I don't really get it. Whats the point of the program if it doesn't open the door?

With the second point, you should be able to that. Just add the certain PDAs that have access to the doors they're meant to have access to.
ninja4523 #85
Posted 22 November 2014 - 02:02 PM
Right now I have this set up in a large village house and I get too close to the door and it opens whether I want it to or not. So maybe a locking system would be good. There is a system like that for pgps which is compatible with this program.
Dex_Luther #86
Posted 02 February 2015 - 11:09 PM
I'm sorry for posting in this somewhat old thread, but I wanted to say thank-you to the author. Just found this, and it's very useful.

First off, love the program, keep up the great work.

I had a couple suggestions that I noticed while playing around with the program.

1) The program doesn't play nice with external monitors unless you make them 5x3 or larger. It would be awesome if it could scale the GUI a bit based on the size of the monitor. Alternatively, direct support for an external monitor that just displays status information could be useful as well.

2) If you have a wired modem connected, which is again useful for connecting external monitors, there can be issues with the program not finding the wireless modem (depending on which side it is attached to).

I haven't been able to connect the monitors at all. Either by wired modems or sticking them to any of the sides of the computer. Did you modify the code at all or does it support monitors "right out of the box"?
Edited on 02 February 2015 - 10:09 PM
cygnis #87
Posted 14 February 2015 - 09:59 PM
Could you also make the program compatible with regular wireless pocomps? I don't have any advanced ones :/
Yea it does work with regular computers.

I haven't been successful in getting it to work with a regular computer. It just keeps telling me it requires an advanced one.
oeed #88
Posted 14 February 2015 - 10:58 PM
Could you also make the program compatible with regular wireless pocomps? I don't have any advanced ones :/
Yea it does work with regular computers.

I haven't been successful in getting it to work with a regular computer. It just keeps telling me it requires an advanced one.
That's odd. I haven't really used this much recently, but I'm pretty sure it works. I don't even think it still has that message. Can you post a screenshot?
cygnis #89
Posted 16 February 2015 - 02:07 AM
Last three lines of your pastebin code (4QeAEiTM):
else
	 print('Ultimate Door Lock requires an advanced (gold) computer or pocket computer.')
end

Screenshot:
Spoiler
_removed #90
Posted 27 February 2015 - 11:31 PM
Great work oeed! Keep up the good work!
cygnis #91
Posted 09 May 2015 - 11:09 PM
Any ideas what may be the issue?
KingofGamesYami #92
Posted 09 May 2015 - 11:21 PM
It says what the "issue" is right in the screenshot. 'Ultimate door lock requires an advanced computer'
cygnis #93
Posted 09 May 2015 - 11:33 PM
Logically you would name it the same as your username :P/>
It just makes the setup process harder really, if I find a public 1.6 server I'll try it out there and see if there's a need.

Update 1 Released

This update adds support for non-advanced computers. Both PDAs and computers will work with out colour screens. This is the first time I've actually made a non-advanced computer GUI, so it's been a bit of an experiment to get it working at an acceptable level of usability. The key in square brackets is they key you press to click the button.


There may be a few bugs related to this, if you do find anything let me know.

No. First update was support to regular computers.
rexthecapt #94
Posted 24 June 2015 - 10:00 PM
Can you change it so you have 2 buttons on the PDA that open and close the door instead for just open when you turn it on?
ME System Boy #95
Posted 15 February 2016 - 04:30 PM
Been a while since I clicked on a link to a door lock program! :P/> Great job, looks awesome. Time to test it out.
Me too! i already tested this with MalisisDoors and i made a vault door to all of my chests, The PDA Feature was very well done :)/> i have a screenshot of it:
(btw sorry for the pic sharing website.)
http://tinypic.com/r/mryd1h/9
It was truely a great door lock program!

PS. Um this was a very amazing program but i found a bug, it would shutdown the Advanced computer sometimes (at least on my pc) and then i would open it up again and it would say
You need a wireless modem!
and i had a wireless modem!
Bye. #96
Posted 16 June 2016 - 11:01 PM
Good job man!
houseofkraft #97
Posted 02 October 2016 - 12:29 AM
When i was testing it out it seemed pretty nice, now i can enter my house safely and easily. Thanks oeed!
XavierTheSniper #98
Posted 03 October 2016 - 05:56 AM
Hello, I don't know if you know this or not but on 1.7 of computer craft its gives an error for line 623: attempt to call nil then it just gives the crashing msg then continuously reboots. When I tried fixing it by removing that line the PDAs did not download the info they needed. Hopefully you fix this as I this is one of the only door openers that gives a pastebin that uses the Advanced personal computers.
KingofGamesYami #99
Posted 03 October 2016 - 12:35 PM
XavierTheSniper, add this line to the top of the program:

unpack = table.unpack

Developers, use this to support all versions:

unpack = unpack or table.unpack
_Alexgale5_YT #100
Posted 11 February 2018 - 05:34 PM
There Should Be A Button Called Lock And It Will Stop The Door From Opening :)/>