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

Help with my ticket machine?

Started by Agent Silence, 06 May 2014 - 06:23 PM
Agent Silence #1
Posted 06 May 2014 - 08:23 PM
I have made a ticket machine, and it is my first REAL computercraft program, but I need help finding a way I can have another computer read the ticket and make sure the info is valid and the ticket isn't a fake.
Side note : I use a printer to make the ticket(s).
CometWolf #2
Posted 06 May 2014 - 09:39 PM
I don't think computers have any means of reading printed paper. You could however use disk dirves with disks instead. The whole security thing isn't really my area though, as personally i believe security in CC is meaningless.
Agent Silence #3
Posted 06 May 2014 - 09:43 PM
I don't think computers have any means of reading printed paper. You could however use disk dirves with disks instead. The whole security thing isn't really my area though, as personally i believe security in CC is meaningless.
I have tried disks, but I have not found a way to store saved data on it for future use. Basically using it as a transportation credit card.
TheOddByte #4
Posted 06 May 2014 - 09:56 PM
I agree with CometWolf, You can use disk drives but it would pretty much be useless since someone could easily gain access to your computer with just a blank disk drive if they rebooted the computer( if they can see the computer that is )
CometWolf #5
Posted 06 May 2014 - 10:43 PM
I have tried disks, but I have not found a way to store saved data on it for future use. Basically using it as a transportation credit card.
Same way you would any other files on your computer, you use the fs API

local creditInfo = "IDK 200?" --lol
local file = fs.open("/disk/creditInfo","w")
file.writeLine(creditInfo)
file.close()

local file = fs.open("/disk/creditInfo","r")
local creditInfo = file.readAll()
file.close()
You get the idea. Though for this stuff to be secure, you'd probably need to use a central server computer communicating via rednet to the drive computers, with encoded transmissions. And that's not even touching on the whole fake disc issue.

Edit: actually come to think of it… Each disk has it's own unique ID, which i don't believe can be spoofed. The disk API's getID will return this value, which could easily be used to know wether the disc is legit or not.
Edited on 06 May 2014 - 08:46 PM
Dayrider10 #6
Posted 06 May 2014 - 11:55 PM
In future cases you can do it and store the info on the disk ,but can't the user craft a computer and edit the information? I would suggest in the future to use servers which at least then has some protection from user edits. That is what I think about when I program. Anyways to do with your problem you should probably go with the disk drives. I don't think it can read printed paper. Correct me if I'm wrong though.
CometWolf #7
Posted 06 May 2014 - 11:58 PM
Well yes, naturally he would have to encrypt the info on the disk, but the point with the IDs was to prevent people from making direct copies of the disks.
cptdeath58 #8
Posted 07 May 2014 - 12:02 AM
I don't think computers have any means of reading printed paper. You could however use disk dirves with disks instead. The whole security thing isn't really my area though, as personally i believe security in CC is meaningless.
I have tried disks, but I have not found a way to store saved data on it for future use. Basically using it as a transportation credit card.
I agree with CometWolf, You can use disk drives but it would pretty much be useless since someone could easily gain access to your computer with just a blank disk drive if they rebooted the computer( if they can see the computer that is )

You can actually use disks as tickets since you can automatically delete the ticket info, however, it would cause an issue anyways because any could hack into the computer and use an unused ticket number. But if you keep it in a secured place and made a peripheral to a drive from that location then that would work. (also some monitors to see if the ticket is correct. )
But you cant have a computer read paper unless someone made an addon like a scanner or something.
Edited on 06 May 2014 - 10:04 PM
HometownPotato #9
Posted 07 May 2014 - 12:03 AM
I would hide a computer and make everything run on a monitor they can see. Maybe using buttons to "scan ticket" or "eject ticket" and use hoppers to transfer the ticket into a hidden location and fire a dispenser or something to eject.
And you can do a basic, secure encryption as long as you know no one will access that computer (with the scan and eject) since you are using a monitor.
cptdeath58 #10
Posted 07 May 2014 - 12:07 AM
I would hide a computer and make everything run on a monitor they can see. Maybe using buttons to "scan ticket" or "eject ticket" and use hoppers to transfer the ticket into a hidden location and fire a dispenser or something to eject.
And you can do a basic, secure encryption as long as you know no one will access that computer (with the scan and eject) since you are using a monitor.
You dont even need hoppers. you just need a connection to a drive.
Ik you can make a peripheral using wired modems to connect the two.

Edit: Plus they can't access the programming without the actual computer. correct if i'm wrong there
Edited on 06 May 2014 - 10:08 PM
Bomb Bloke #11
Posted 07 May 2014 - 12:23 AM
Security in ComputerCraft mostly boils down to whether or not you can prevent direct access to your server computer(s) (something which typically can't be done if CC is your only mod, but there are plenty of ways to pull it off in most modpacks).

Assuming a securely-placed server, properly done wireless encyption has always been viable - even if your methods are known, so long as your keys are never revealed to those who shouldn't have them that's fine.

In this case, I'd have a remote server that generates a random key for each user. That key is stored on the disk along with the ATM client software - you have no dedicated ATM machines, you instead rig things so that users can boot their own secure copies of your ATM software via their own personal disks (shutting down the computer, inserting the disk, then booting back up (in that order) should prevent malicious copying by third parties).

When they use the disk, any transmissions between the client computer and server computers would be encrypted with the key in concern. In this manner, the only weak points should be users sharing their disk contents with other users (in which case all that could be broken into would be their own accounts - tell 'em to hang on to those charms of keeping!), or the server itself (which you'd want to lock behind warded blocks or whatever).

Not to go off on too much of a tangent, but it occured to me the other day that there's a much easier way to authenticate some systems - a reverse GPS lookup. No good on its own for hiding transmission contents, but great if you want to be sure a transmission came from a system at a certain location.
HometownPotato #12
Posted 07 May 2014 - 12:25 AM
But with hoppers, you can make sure they don't eject anytime they want. So if the "ticket machine" is accessing the server to see if they can enter, may require some time and if they eject it, you _might_ have problems (depending how you handle everything).
cptdeath58 #13
Posted 07 May 2014 - 12:32 AM
But with hoppers, you can make sure they don't eject anytime they want. So if the "ticket machine" is accessing the server to see if they can enter, may require some time and if they eject it, you _might_ have problems (depending how you handle everything).
Security in ComputerCraft mostly boils down to whether or not you can prevent direct access to your server computer(s) (something which typically can't be done if CC is your only mod, but there are plenty of ways to pull it off in most modpacks).

Assuming a securely-placed server, properly done wireless encyption has always been viable - even if your methods are known, so long as your keys are never revealed to those who shouldn't have them that's fine.

In this case, I'd have a remote server that generates a random key for each user. That key is stored on the disk along with the ATM client software - you have no dedicated ATM machines, you instead rig things so that users can boot their own secure copies of your ATM software via their own personal disks (shutting down the computer, inserting the disk, then booting back up (in that order) should prevent malicious copying by third parties).

When they use the disk, any transmissions between the client computer and server computers would be encrypted with the key in concern. In this manner, the only weak points should be users sharing their disk contents with other users (in which case all that could be broken into would be their own accounts - tell 'em to hang on to those charms of keeping!), or the server itself (which you'd want to lock behind warded blocks or whatever).

Not to go off on too much of a tangent, but it occured to me the other day that there's a much easier way to authenticate some systems - a reverse GPS lookup. No good on its own for hiding transmission contents, but great if you want to be sure a transmission came from a system at a certain location.
HometownPotato: Most programs runs in a fraction of a sec to check this. Plus if it didn't, it would generate an error and the ticket wouldn't be validated. But it is a good idea when it comes to security disks.
Bomb Bloke: True, security does suck without any other mods ,but this is a ticket machine so I don't see any needs for a server unless you ran mutliple machines then that wouldn't be a problem because people on those ticket machines are the ones getting it, so they cant do so. though, it would work great as a program that needs to be payed in-game, such as an os or security feature.