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

A security mainframe

Started by V497_Vesper, 23 June 2015 - 05:36 PM
V497_Vesper #1
Posted 23 June 2015 - 07:36 PM
Is it possible to use Computercraft to create a security mainframe that holds the codes for the locks to your base and will trigger an alarm when someone tries to tamper with it? Also if possible can it be overridden my a single master code despite all of the other codes like for example
Door: Oxyen farm
code: 22324235
Master code: Biscuits

this is also a dual question as i am wondering if Computercraft can also be used to report base telemetry to the mainframe with a status report sort of a damage report system as it were just a question and since i got a good answer for my previous posting I was wondering if i could do that again with this idea

here is the pastebin of my previous question of anyone wants to use it

Program: Nuclear Control Progressive heat monitoring system
with computercraft PA system

Code: Tfe3jDhE
Edited on 23 June 2015 - 05:40 PM
KingofGamesYami #2
Posted 23 June 2015 - 08:27 PM
If I'm reading this correctly, what you want can be done.

You could create a master server which stores the codes. When a computer attempts to log in, it sends the entered password to the master server via rednet. The master server responds with either "true" or "false", depending on whether or not the correct password was sent.

But, anything using rednet is insecure. The most secure thing I ever did over rednet was set up a rolling-code pda lock, where the pda sent a different password each time. Each password was one-time use only, and a new password was generated from the previous via an algorithm. Of course, if they know the algorithm used, it's easy to break.

I don't understand what you mean by "damage report". A computer cannot tell if it's been destroyed, if that's what your thinking.
InDieTasten #3
Posted 23 June 2015 - 08:29 PM
To your idea:
What you want to achieve is totally possible, but a ton of work, because you are requesting many many modules that need to interconnect, so it's hard to modularly reuse other programs thats already out in the wild. I would estimate the time me personally would need to code up something like this in like 2 hours, when it needs to be as minimal as you are describing. But you want to ultimately want to keep it modular which would double the development time but enables for easier expansion.

So yeah, totally possible, but might be a bit much for beginners, since the status report(or system health analysis as how I am understanding it) can become somewhat different with checking all services that you're running in your scenario. If you are able to develop it, I would like to see some videos or images in the media section ;)/>

To your program:
You might as well put it onto the forums in the programs section, with detailed description of what it does, how to use it and such ;)/>
V497_Vesper #4
Posted 23 June 2015 - 08:31 PM
basically what i am asking is can a computer detect a change in a certain area, e.g.

say you have a long hallway with a computer linked to it and suddenly the wall explodes for some reason be it a creeper or a meteroite or someone basically griefed you with TNT can the computer let you know that the hallway has been damaged? It is sort of a theoretical idea and I think would be good if it could actually be achieved
Edited on 23 June 2015 - 06:34 PM
KingofGamesYami #5
Posted 23 June 2015 - 08:34 PM
basically what i am asking is can a computer detect a change in a certain area, e.g.

say you have a long hallway with a computer linked to it and suddenly the wall explodes for some reason be it a creeper or a meteroite or someone basically griefed you with TNT can the computer let you know that the hallway has been damaged?

No. The best you can get is continually scanning the area with a command computer (…but then you need command computers) which is pretty slow. I had a program that scanned 10 blocks over and over. Each iteration took 0.75 seconds… Imagine scanning an entire house.
InDieTasten #6
Posted 23 June 2015 - 08:34 PM
If I'm reading this correctly, what you want can be done.

You could create a master server which stores the codes. When a computer attempts to log in, it sends the entered password to the master server via rednet. The master server responds with either "true" or "false", depending on whether or not the correct password was sent.

But, anything using rednet is insecure. The most secure thing I ever did over rednet was set up a rolling-code pda lock, where the pda sent a different password each time. Each password was one-time use only, and a new password was generated from the previous via an algorithm. Of course, if they know the algorithm used, it's easy to break.

I don't understand what you mean by "damage report". A computer cannot tell if it's been destroyed, if that's what your thinking.
Although it's somewhat offtopic, I can recommend reading something about token authentication. Only requires hashing:
1. Client sends request to server
2. Server sends random token to client
3. Client generates his own token and hashes it with the entered pw
4. Client sends the hash value of (server token, client token and pw) plus client token raw to server
5. Server can verify by checking, if server token + client token + pw(from db) has an equal hash value

Easier to implement than to actually explain ^^
V497_Vesper #7
Posted 23 June 2015 - 08:39 PM
basically what i am asking is can a computer detect a change in a certain area, e.g.

say you have a long hallway with a computer linked to it and suddenly the wall explodes for some reason be it a creeper or a meteroite or someone basically griefed you with TNT can the computer let you know that the hallway has been damaged?

No. The best you can get is continually scanning the area with a command computer (…but then you need command computers) which is pretty slow. I had a program that scanned 10 blocks over and over. Each iteration took 0.75 seconds… Imagine scanning an entire house.

Yeah i can see your point but i was just curious if it was possible, the main thing i wanted to go for was a mainframe that stored passwords that could be overridden by another password
InDieTasten #8
Posted 23 June 2015 - 08:39 PM
basically what i am asking is can a computer detect a change in a certain area, e.g.

say you have a long hallway with a computer linked to it and suddenly the wall explodes for some reason be it a creeper or a meteroite or someone basically griefed you with TNT can the computer let you know that the hallway has been damaged? It is sort of a theoretical idea and I think would be good if it could actually be achieved
With several turtles scanning the area(really really tedious) this can work.
Alternatively(with some sensors) you can sense item stack entities, which is what I used before. So whenever someone forcefully breaks in, the material the walls are made of are dropped as item stack. You can then lock your computers for example.

The only problem is: If they can break your walls, they most certainly are able to break your computers. Then your system health report comes in handy. You can check your computers by other computers(that are hidden deep inside the floor or whatever) to send out wanrings for example. I used terminal glasses to transmit this information, as these work over several worlds in multiplayer and infinite range