Isn't it possible to make a encryption macro to secure the communication between two devices?
I found the math for the Diffie Helman crypto, and it doesn't look like it's wont work on a microcontroller.
More than this, there are examples for Arduino to use this.
Look at this: https://github.com/DevMomo/Diffie-Hellman-Arduino
Maybe something to use in Flowcode?
Maybe a "master" and "slaves" macro?
The master will generate the prime number and shares it with the slaves?
Cryptography (like Diffie Helman )
Moderator: Benj
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Cryptography (like Diffie Helman )
Yes this is certainly possible. I'll add it to the list and investigate how much work it would be to add in.
Seems to be a form of PGP Public Private Key, I've studied this and know how it works but am a little rusty on the subject. PGP was developed by a programmer under contract and when he realised what he had, he released it for free to the public as open source. He went to jail for it because it was the IP of the company who employed him. Thanks to this public availability we now have things like digitally secure signatures and advanced WIFI network protection.
I've got quite far in making a component, everything apart from the setup and loop code.
However the example code use the randomSeed function which is not available for PIC devices. It seems pretty important as it is called multiple times. Maybe it's just a way of adding extra randomness? But I wonder if it is somehow syncing the random values from tx and rx?
Hmmm...
I can make it work for AVR no problem but PICs and other targets may have problems.
Seems to be a form of PGP Public Private Key, I've studied this and know how it works but am a little rusty on the subject. PGP was developed by a programmer under contract and when he realised what he had, he released it for free to the public as open source. He went to jail for it because it was the IP of the company who employed him. Thanks to this public availability we now have things like digitally secure signatures and advanced WIFI network protection.
I've got quite far in making a component, everything apart from the setup and loop code.
However the example code use the randomSeed function which is not available for PIC devices. It seems pretty important as it is called multiple times. Maybe it's just a way of adding extra randomness? But I wonder if it is somehow syncing the random values from tx and rx?
Code: Select all
//reseed the random number generator with the shared secret key k
randomSeed(k);
Yes there seems to be a sync going on there.randomSeed() initializes the pseudo-random number generator, causing it to start at an arbitrary point in its random sequence. This sequence, while very long, and random, is always the same.
Hmmm...
I can make it work for AVR no problem but PICs and other targets may have problems.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 502
- Joined: Wed Nov 07, 2007 6:51 pm
- Location: Antwerp Belgium
- Has thanked: 121 times
- Been thanked: 108 times
- Contact:
Re: Cryptography (like Diffie Helman )
Looks good BenJ
I'm watching this like a cow watches a passing train.
For now I don't understand whats going on, but on the other hand, I never said I'm smart
Thanks for your efforts.
Hope to have a working macro in the future.
I'm watching this like a cow watches a passing train.
For now I don't understand whats going on, but on the other hand, I never said I'm smart
Thanks for your efforts.
Hope to have a working macro in the future.
-
- Posts: 4
- Joined: Tue Apr 07, 2020 6:49 pm
- Contact:
Re: Cryptography (like Diffie Helman )
PIC24F128GA204 has a built-in hardware AES encryption. It may generate random seed.
Just copy to it and see what can happen.
Just copy to it and see what can happen.