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

Encryption Api

Started by AssossaGPB, 21 June 2014 - 07:11 PM
AssossaGPB #1
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
TheOddByte #2
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 '!'
theoriginalbit #3
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
AssossaGPB #4
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
theoriginalbit #5
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.
0099 #6
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.
AssossaGPB #7
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