Jump to content




Help with my ticket machine?

help

12 replies to this topic

#1 Agent Silence

  • Members
  • 319 posts
  • Location[string "FindMe"]:23143: bad argument #1 to 'returnPos' (vector expected, got nil)

Posted 06 May 2014 - 07: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).

#2 CometWolf

  • Members
  • 1,283 posts

Posted 06 May 2014 - 08: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.

#3 Agent Silence

  • Members
  • 319 posts
  • Location[string "FindMe"]:23143: bad argument #1 to 'returnPos' (vector expected, got nil)

Posted 06 May 2014 - 08:43 PM

View PostCometWolf, on 06 May 2014 - 08:39 PM, said:

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.

#4 TheOddByte

    Lazy Coder

  • Members
  • 1,607 posts
  • LocationSweden

Posted 06 May 2014 - 08: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 )

#5 CometWolf

  • Members
  • 1,283 posts

Posted 06 May 2014 - 09:43 PM

View PostAgent Silence, on 06 May 2014 - 08:43 PM, said:

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 by CometWolf, 06 May 2014 - 09:46 PM.


#6 Dayrider10

  • Members
  • 32 posts

Posted 06 May 2014 - 10: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.

#7 CometWolf

  • Members
  • 1,283 posts

Posted 06 May 2014 - 10: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.

#8 cptdeath58

  • Members
  • 139 posts
  • LocationError 404: Could not find.

Posted 06 May 2014 - 11:02 PM

View PostAgent Silence, on 06 May 2014 - 08:43 PM, said:

View PostCometWolf, on 06 May 2014 - 08:39 PM, said:

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.

View PostTheOddByte, on 06 May 2014 - 08:56 PM, said:

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 by cptdeath58, 06 May 2014 - 11:04 PM.


#9 HometownPotato

  • Members
  • 62 posts

Posted 06 May 2014 - 11:03 PM

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.

#10 cptdeath58

  • Members
  • 139 posts
  • LocationError 404: Could not find.

Posted 06 May 2014 - 11:07 PM

View PostHometownPotato, on 06 May 2014 - 11:03 PM, said:

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 by cptdeath58, 06 May 2014 - 11:08 PM.


#11 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 06 May 2014 - 11:23 PM

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.

#12 HometownPotato

  • Members
  • 62 posts

Posted 06 May 2014 - 11:25 PM

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).

#13 cptdeath58

  • Members
  • 139 posts
  • LocationError 404: Could not find.

Posted 06 May 2014 - 11:32 PM

View PostHometownPotato, on 06 May 2014 - 11:25 PM, said:

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).

View PostBomb Bloke, on 06 May 2014 - 11:23 PM, said:

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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users