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

NovaNet

Started by Exerro, 28 May 2014 - 01:47 PM
Exerro #1
Posted 28 May 2014 - 03:47 PM
NovaNet is a new networking API I made. It features *very secure* encryption, and routing through multiple computers in a network.
The main feature is that it is very simple to use. There are no complicated server/client/router networks you have to set up, only a minimum of 3 computers to have a working network where 2+ computers can communicate. It also works with wireless/wired modems (both on the same network).


You need to host( ) on one computer, then other computers can connect to that, or other connected computers.
For example, this setup:

Computer 1:

network.host( )
Computer 2:

network.connect( "1" )
Computer 3:

network.connect( "2" )
local message = network.receive( )
print( "Got message from "..message:getSender( )..":" ) --> Got message from 3:
print( message:getMessage( ) )						  --> Hello world!
message:respond( "Received!" )
Computer 4:

network.connect( "1" )
local response = network.send( "2>3", "Hello world!" )
print( "Got response: "..tostring( response:waitFor( 1 ) ) ) --> Got response: Received!

The encryption is *very secure* because it re-encrypts multiple times along it's route with keys of the IDs. This means only 1 computer at a time can read the message, not even the destination computer will be able to read it until it has travelled the full route. This does however add in an issue: it can lead to long messages causing lag because they are encrypted/decrypted multiple times. I may add in some fixes for this in the future (basically simplifying the encryption/decryption).

In addition to the network API, I have created some programs to use with it, and a couple of other APIs.
The other APIs:
  • GUI - A very small GUI library aimed for simple web scripts.
  • Script - A small script API that is formatted similar to HTML. It can only be used with the GUI API.
The programs are:
  • Server - Act as a main server and allow other computers to communicate.
  • Router - Act as a router, allowing computers to connect and route messages through it.
  • Send - Send a string data to another computer.
  • Receive - Receive messages and print their sender and data.
  • DNS - Host a DNS server. Send {protocol = "DNS", request = "lookup" or "register", name = [the name for your address]}.
  • FTP - Host a ftp server, with read and write commands. Send {protocol = "FTP", request = "read" or "write", path = [path to file], content = [content of file in write mode]}.
  • WebServer - Host a website (websites are folders containing files to be loaded with the script API).
  • Browser - A basic web browser, connect to a website and view/run it's contents.
To get these programs (and the API), go to github.
Now I guess the main attraction of a networking API is websites (or emails I guess), but for making websites, use the following syntax:

<type param:value param2:value2>Content</type>
<row param:value...> children... </row>
<column param:value...> children... </column>
For example, to make an address bar:

<row size:n1>
<input id:n1 size:n47>web address</input>
<button size:n4 bcol:cyan tcol:white onClick:l"
  local page = getAttribute( 1, "text" )
  browser.gotopage( page )
">goto</button>
</row>
<text size:n3 bcol:lightBlue halign:centre>Type in the name of the page you want to visit then press goto</text>
This would output:
Spoiler
More info is in the browser program.

I will be making an interactive installer at some point, which will allow you to download different components individually or download everything at once, and also add in list and image elements into the GUI/script. I might also make a website creator and I will definitely improve the browser/web server programs to have a GUI, but that will probably come later.
Edit: made the installer: pastebin get yynKGXy1 install
Edited on 28 May 2014 - 02:15 PM
Blue #2
Posted 28 May 2014 - 07:31 PM
I think that this should go in:APIs and Utilities
Exerro #3
Posted 28 May 2014 - 09:53 PM
There are 3 APIs but there are also multiple programs each working and useful so I would disagree.
LDShadowLord #4
Posted 28 May 2014 - 09:54 PM
Instead of simplifying the encryption, just make the level of encryption toggle-able. By default it sends at "1" which is super-simple encryption or you can choose "3" which is very-complex encryption. Maybe if you choose "11" or some other number it hashes instead of encrypting. Then you can make secure password transfers.
apemanzilla #5
Posted 28 May 2014 - 10:36 PM
This is a very weak encryption. A simple brute force could easily crack this, as it just uses math.randomseed and then shifts the characters. I would recommend using a real encryption algorithm.
ardera #6
Posted 28 May 2014 - 10:53 PM
This is a very weak encryption. A simple brute force could easily crack this, as it just uses math.randomseed and then shifts the characters. I would recommend using a real encryption algorithm.
Yep. Trial Error to decrypt using ids from 1 - infinite and wait for loadstring not throwing errors. A combination of id and distance would be safe, or at least safer.
apemanzilla #7
Posted 28 May 2014 - 10:57 PM
This is a very weak encryption. A simple brute force could easily crack this, as it just uses math.randomseed and then shifts the characters. I would recommend using a real encryption algorithm.
Yep. Trial Error to decrypt using ids from 1 - infinite and wait for loadstring not throwing errors. A combination of id and distance would be safe, or at least safer.
It wouldn't change anything, really. Heck, you could brute force this with a couple computercraft computers, in a couple SECONDS…
Exerro #8
Posted 29 May 2014 - 12:19 AM
Surprised I didn't think of that…how would you reccommend doing the encryption? The way I see it, if one computer can decrypt it, so can another…the only secure way is making the key to decrypting it hard to access for the malicious computer. Also, I wouldn't go as far as "very weak", the average computercraft user wouldnt know how to do it, and brute forcing would take a long time. Any comments on other features?
cptdeath58 #9
Posted 29 May 2014 - 12:25 AM
This is a very weak encryption. A simple brute force could easily crack this, as it just uses math.randomseed and then shifts the characters. I would recommend using a real encryption algorithm.
Yep. Trial Error to decrypt using ids from 1 - infinite and wait for loadstring not throwing errors. A combination of id and distance would be safe, or at least safer.
This is a very weak encryption. A simple brute force could easily crack this, as it just uses math.randomseed and then shifts the characters. I would recommend using a real encryption algorithm.
Yep. Trial Error to decrypt using ids from 1 - infinite and wait for loadstring not throwing errors. A combination of id and distance would be safe, or at least safer.
It wouldn't change anything, really. Heck, you could brute force this with a couple computercraft computers, in a couple SECONDS…
Actually, it depends on how long the password is.
the longer the pass, the longer it takes.
you could break a hundred character pass, but within a couple of seconds ( Um.. how about.. Nope, not happening )
That being said, it will depend on encryption to figure how long it would take.

[EDIT] So ya, you could brute force it, but it would take time.
[*EDIT] You can also place a simple Trial Error protection by limiting the amount of tries to prevent this.
Edited on 28 May 2014 - 10:29 PM
Exerro #10
Posted 29 May 2014 - 12:34 AM
Trial error protection? When the malicious computer has the message, it can try it as many times as it wants surely.
cptdeath58 #11
Posted 29 May 2014 - 12:38 AM
Actually, you can limit the amount of time it can try…
Edited on 28 May 2014 - 10:38 PM
apemanzilla #12
Posted 29 May 2014 - 12:48 AM
Actually, you can limit the amount of time it can try…
Nope. Once the computer gets access to it via modem API, it's out of your control.

Additionally, I'm fairly sure the average CC user is capable of writing a "for i = 1, 9999999" loop to try all possible combinations to decrypt it.
cptdeath58 #13
Posted 29 May 2014 - 12:51 AM
Question though, doesn't it got to send messages to the server to receive access to it first
PixelToast #14
Posted 29 May 2014 - 12:58 AM
"It features *very secure* encryption, and routing through multiple computers in a network."

challenge… accepted.
Exerro #15
Posted 29 May 2014 - 01:04 AM
No, messages just broadcast across a network when a computer has already connected.

Additionally, I was referring to the getting the message, decrypting it, and then using textutils.unserialize and checking if all that worked, not a for loop
Edited on 28 May 2014 - 11:04 PM
cptdeath58 #16
Posted 29 May 2014 - 01:09 AM
Oh ok, but it still will take time to crack it
PixelToast #17
Posted 29 May 2014 - 01:32 AM
no, it wont, i am generating a key table which which will break the encrypion in miliseconds
apemanzilla #18
Posted 29 May 2014 - 01:34 AM
No, messages just broadcast across a network when a computer has already connected.

Additionally, I was referring to the getting the message, decrypting it, and then using textutils.unserialize and checking if all that worked, not a for loop
A for loop would be used to iterate through all the possible IDs to brute force it. And in addition to the source code of the algorithm, that's basically all you need to brute force the encryption key.
Exerro #19
Posted 29 May 2014 - 01:38 AM
i definitely regret saying "very secure" now….although in my defense it was my second attempt at any sort of encryption and seemed to work well. any comments on any other features? the network structure, for example
cptdeath58 #20
Posted 29 May 2014 - 01:58 AM
no, it wont, i am generating a key table which which will break the encrypion in miliseconds
Dude, you obviously don't know how long it actually takes to crack a very secured encryption ( Suggesting the password was atleast 10 characters long )
theoriginalbit #21
Posted 29 May 2014 - 02:15 AM
Dude, you obviously don't know how long it actually takes to crack a very secured encryption ( Suggesting the password was atleast 10 characters long )
Dude, you obviously don't know what a 'very secured encryption' is… this 'encryption' is far from it, its more of an encoding scheme really…
cptdeath58 #22
Posted 29 May 2014 - 02:40 AM
Dude, you obviously don't know how long it actually takes to crack a very secured encryption ( Suggesting the password was atleast 10 characters long )
Dude, you obviously don't know what a 'very secured encryption' is… this 'encryption' is far from it, its more of an encoding scheme really…
I said Suggesting the password was atleast 10 characters long .-.
Learn to read
theoriginalbit #23
Posted 29 May 2014 - 03:04 AM
I said Suggesting the password was atleast 10 characters long .-.
Learn to read
I know how to read, password length is irrelevant when dealing with bad encryption.
lieudusty #24
Posted 29 May 2014 - 03:48 AM
no, it wont, i am generating a key table which which will break the encrypion in miliseconds
Dude, you obviously don't know how long it actually takes to crack a very secured encryption ( Suggesting the password was atleast 10 characters long )

This doesn't take a long period of time to crack though…

The encryption key is just the computer's ID. All you need to do to crack it, is to run the decrypt function in a loop and test IDs from 0 - 65535. It'll take at most, several minutes.
Edited on 29 May 2014 - 01:50 AM
PixelToast #25
Posted 29 May 2014 - 04:31 AM
no, it wont, i am generating a key table which which will break the encrypion in miliseconds
Dude, you obviously don't know how long it actually takes to crack a very secured encryption ( Suggesting the password was atleast 10 characters long )
password length isnt necicarily better in this case, the weak point is currently the key generation, as it has a tiny amount of possible keys it could generate (under 1 million)
i dont brute force the password itself, i run through all the possible keys and detect which one loads properly
1 million might sound like a lot but it isnt, in LuaJIT it would take seconds to generate the table and after i have the table, cracking is instant

i take that back you can crack it in under a second using just CC, the password is the destination id

/quit *slow clap*
ardera #26
Posted 29 May 2014 - 10:40 AM
This is a very weak encryption. A simple brute force could easily crack this, as it just uses math.randomseed and then shifts the characters. I would recommend using a real encryption algorithm.
Yep. Trial Error to decrypt using ids from 1 - infinite and wait for loadstring not throwing errors. A combination of id and distance would be safe, or at least safer.
It wouldn't change anything, really. Heck, you could brute force this with a couple computercraft computers, in a couple SECONDS…
I said it would make things safer, not "ultimate encryption! uncrackable!", I know this could be cracked in a few secs.
apemanzilla #27
Posted 29 May 2014 - 02:00 PM
no, it wont, i am generating a key table which which will break the encrypion in miliseconds
Dude, you obviously don't know how long it actually takes to crack a very secured encryption ( Suggesting the password was atleast 10 characters long )
With this system, we can guarantee for a FACT that the key is an integer, which eliminates infinite possibilities RIGHT there, and we also know that the key is most likely lower than 200, with a few exceptions. So, iterate through 1-200, trying the decryption each time, and you'll have a pretty good shot at getting the key.
Even worse, technically, two keys can generate the same encrypted text for the same input with this algorithm, so find out how many unique keys there are and you can crack it no matter what.
Edited on 29 May 2014 - 12:03 PM