132 posts
Location
Florida, USA
Posted 21 June 2014 - 09:11 PM
Encryption API
This api allows you to easily do key exchanges for rednet encryption. It does not do the actual encryption, for that you can use any api, but I recommend [topic='42']StrUtils[/topic].
Features:
•
Diffie–Hellman key exchange•Client and Server side functions
Installation:
pastebin get 3AVxLZzT encryptApi
Functions:
keyExchangeServer(clientID)
keyExchangeClient(serverID)
openRednet(side)
getKey()
Edited on 21 June 2014 - 07:13 PM
1852 posts
Location
Sweden
Posted 21 June 2014 - 09:45 PM
Have you tested this yourself?
while !isPrime( num1 ) do
because that's wrong syntax, use 'not' instead of '!'
7508 posts
Location
Australia
Posted 22 June 2014 - 03:54 AM
your isPrime function is also flawed, it will report that some numbers are prime when they're not.
Edited on 22 June 2014 - 01:54 AM
132 posts
Location
Florida, USA
Posted 22 June 2014 - 07:35 PM
Have you tested this yourself?
while !isPrime( num1 ) do
because that's wrong syntax, use 'not' instead of '!'
Whoops!
Fixing now, thanks for that!
your isPrime function is also flawed, it will report that some numbers are prime when they're not.
How so? I'm not good with finding prime numbers :P/>
Everyone, please report any bugs/glitches/security holes you find! Thanks!
Edited on 23 June 2014 - 12:18 AM
7508 posts
Location
Australia
Posted 23 June 2014 - 03:27 AM
How so? I'm not good with finding prime numbers :P/>
well in particular multiples of 2 would return true with your function. here take a look at
this, even its not perfect, but its much closer than your solution.
52 posts
Posted 05 July 2014 - 10:52 PM
How does your rednetWait function returns any value? I can't see any returns in it… But in agreeNums you expect some numbers from it.
132 posts
Location
Florida, USA
Posted 06 July 2014 - 01:15 AM
How does your rednetWait function returns any value? I can't see any returns in it… But in agreeNums you expect some numbers from it.
Whoops! Fixing now, sorry