This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
Which method for transmitting is better?
Started by TechMasterGeneral, 03 July 2015 - 02:19 AMPosted 03 July 2015 - 04:19 AM
Hey everyone! I'm trying to comeback to the community again (was LuaCrawler… decided it was time for a name change). That being said I would like to know what you all would suggest for wireless networking. Right now i'm trying to make a program set that allows for seamless encrypted chat communications but i've kinda hit a wall over which api to use. One part of me wants to use modem api but i'm not sure of a way to check to see which channels are being used by other computers and which aren't. Rednet seemed like a good idea initially because of the different protocols and hostname features that could be used. I'm not which way is better for what i'm doing and would like to see what you all think.
Posted 03 July 2015 - 04:38 AM
I think you shod either use lyqydnet or rednet rednet.lookup can be used to find protocols and or users on a specific protocol
Posted 03 July 2015 - 06:38 AM
If security is something you are worried about, then I would suggest using modem api. Otherwise there is nothing wrong with rednet.
Modem api gives you more control over what is going on in the background ex: what channel will be used.
Modem api gives you more control over what is going on in the background ex: what channel will be used.
Edited on 03 July 2015 - 04:42 AM
Posted 03 July 2015 - 09:28 AM
Modem API is easy to use,
just do a peripheral.wrap() to the modem, and after modem.transmit(Channel,ReplyChannel,MESSAGE). And receive computer must be open on the channel with Modem.open(CHANNEL)…. And you can put at frequence from 0 to around 60 000
just do a peripheral.wrap() to the modem, and after modem.transmit(Channel,ReplyChannel,MESSAGE). And receive computer must be open on the channel with Modem.open(CHANNEL)…. And you can put at frequence from 0 to around 60 000
Posted 03 July 2015 - 01:26 PM
Wow! Lyqydnet looks pretty awesome. I might try my hand at that.I think you shod either use lyqydnet or rednet rednet.lookup can be used to find protocols and or users on a specific protocol
Posted 03 July 2015 - 01:32 PM
Yeah. I'm not sure how to see what channels are being used though. For instance, If I open channel 4765 on a computer someone could be using that channel and I don't want traffic between the computers on 4765 for the secure chat to be sniffed by the other user. I think what I decided was to just put a key up somewhere on the internet and use http to grab it separately. This way I don't have to worry about it being hard coded and then someone looking at the program and knowing how to hack it.If security is something you are worried about, then I would suggest using modem api. Otherwise there is nothing wrong with rednet.
Modem api gives you more control over what is going on in the background ex: what channel will be used.
Posted 03 July 2015 - 01:39 PM
Yeah. I'm not sure how to see what channels are being used though. For instance, If I open channel 4765 on a computer someone could be using that channel and I don't want traffic between the computers on 4765 for the secure chat to be sniffed by the other user. I think what I decided was to just put a key up somewhere on the internet and use http to grab it separately. This way I don't have to worry about it being hard coded and then someone looking at the program and knowing how to hack it.If security is something you are worried about, then I would suggest using modem api. Otherwise there is nothing wrong with rednet.
Modem api gives you more control over what is going on in the background ex: what channel will be used.
The problem with that then is if I wanted to hack your system, I just have an extra step to get your channel. Other than run time encryption, there is little you can do security wise.
Posted 03 July 2015 - 01:43 PM
Well correct me if I'm wrong, but I have to use the same AES key that I encrypted the message with to decrypt that message right? Or can I use 2 different keys?Yeah. I'm not sure how to see what channels are being used though. For instance, If I open channel 4765 on a computer someone could be using that channel and I don't want traffic between the computers on 4765 for the secure chat to be sniffed by the other user. I think what I decided was to just put a key up somewhere on the internet and use http to grab it separately. This way I don't have to worry about it being hard coded and then someone looking at the program and knowing how to hack it.If security is something you are worried about, then I would suggest using modem api. Otherwise there is nothing wrong with rednet.
Modem api gives you more control over what is going on in the background ex: what channel will be used.
The problem with that then is if I wanted to hack your system, I just have an extra step to get your channel. Other than run time encryption, there is little you can do security wise.
Posted 03 July 2015 - 04:17 PM
Well correct me if I'm wrong, but I have to use the same AES key that I encrypted the message with to decrypt that message right? Or can I use 2 different keys?-snip-
The problem is I can read your program and re-engineer it's encryption/decryption parts for malicious use and fetch the key from your server. The way to prevent this is to use byte code but that is not allowed on the forums ("malicious code smuggling" as I call it).
The only 2 key system I know of from encryption is public key if you can get that working, you should be safer, just have the user make there own private key.
Note: CC doesn't lend itself well to security, also I'm no expert on encryption.
Also: Why does a chat program need encryption?
My solution to my theoretical needs of preventing my CC data being read is to bit shift it a number of times. Although that is more to prevent my code from trying to understand another systems rednet chatter. (My theoretical scenario is in my Hive system, sending data to turtles [we are likely not going to do it this way though, this idea was from ages ago])
Edited on 03 July 2015 - 02:18 PM
Posted 03 July 2015 - 04:36 PM
If it's a simple chat program, then the easiest and the best method would be to ask the user to input the password themselves. That way users would simply share their chat passwords. For other data transmission, you could use the Diffie–Hellman key exchange method.
Posted 03 July 2015 - 05:07 PM
Yeah my plan was to use RSA key pairs for the users but have the public keys stored on a server computer program (maybe). I'm more doing this as a proof of concept to make using key pairs seamless. I just wanted a way to encrypt the public keys before sending them to the key server and then I realized I would need the key I encrypted them with on the key server already. I was going to use the cryptographic accelerator from immibis peripherals btw.Well correct me if I'm wrong, but I have to use the same AES key that I encrypted the message with to decrypt that message right? Or can I use 2 different keys?-snip-
The problem is I can read your program and re-engineer it's encryption/decryption parts for malicious use and fetch the key from your server. The way to prevent this is to use byte code but that is not allowed on the forums ("malicious code smuggling" as I call it).
The only 2 key system I know of from encryption is public key if you can get that working, you should be safer, just have the user make there own private key.
Note: CC doesn't lend itself well to security, also I'm no expert on encryption.
Also: Why does a chat program need encryption?
My solution to my theoretical needs of preventing my CC data being read is to bit shift it a number of times. Although that is more to prevent my code from trying to understand another systems rednet chatter. (My theoretical scenario is in my Hive system, sending data to turtles [we are likely not going to do it this way though, this idea was from ages ago])
Yeah people being able to read the program is a risk I'm going to have to take. But like I said its more proof of concept.
Posted 03 July 2015 - 05:51 PM
I came around asking about asymetric encryption (the kind with public and private keys) not too long ago and learned that asymetric is not possible in computercraft because cc cannot calculate the massive numbers for RSA encryption. If you want something similar, you should use AES with a diffe-Hellman key exchange. Its a bit less efficient, but is gets the job done.
Posted 03 July 2015 - 06:14 PM
If it's a proof of concept then go for it, but if you have to send sensitive data then don't use CC with that data.
Have a look at other encryption posts of the forums for more tips.
Have a look at other encryption posts of the forums for more tips.
Posted 06 July 2015 - 06:55 PM
Is there any project available with DH (Diffie–Hellman key exchange) support for ComputerCraft?
I think that will be the easiest and securest methode for me for my "big nuclear reactor"-project, coz i need to use multiple wireless-network connections but dont want to add hardcoded encryption-keys..
I think i cant code DH myself :rolleyes:/>
Ive found this: http://www.computerc...s-various-apis/
but im not sure if it will work.. ?
I think that will be the easiest and securest methode for me for my "big nuclear reactor"-project, coz i need to use multiple wireless-network connections but dont want to add hardcoded encryption-keys..
I think i cant code DH myself :rolleyes:/>
Ive found this: http://www.computerc...s-various-apis/
but im not sure if it will work.. ?
Edited on 06 July 2015 - 05:00 PM