# End-to-End Encryption: RSA

by Niels Triple

Version 4 (December 30, 2018)

After I made the Diffie-Hellman flow, fellow Automate communitymember Cook IT gave me the idea to try and "do" RSA encryption.

RSA was even harder to understand than Diffie-Hellman, but luckily I absolutely SUCK at math, so this was an absolute nightmare to figure out...

Just like my Diffie-Hellman flow, the calculations sometimes get messed up by Automate:
Apparently Automate defines any number that has more than 300-something digits as "infinity", and sometimes big numbers get morphed into the scientific notation for no reason, so I ended up using 2 digit prime numbers to keep the calculations below infinity (2 digits for the Diffie-Hellman flow, 1 digit primes for the RSA flow). THIS FLOW WILL STILL FAIL SOMETIMES BECAUSE OF THE ABOVE REASONS!

1 or 2 digit numbers are a loooooong way from the desired 2048 digit numbers I need to create the keys I want (1024 digit numbers create encryptionkeys that can be cracked by someone with NSA-like capabilities), so this flow is only meant to help you understand how encryption works, not to actually use as encryption (allthough it is possible)

https://en.m.wikipedia.org/wiki/RSA_(cryptosystem)
https://en.m.wikipedia.org/wiki/Coprime_integers
https://en.m.wikipedia.org/wiki/Modular_arithmetic

And this guy, Eddie Woo, deserves a medal for actually making me understand how to calculate this:
https://youtu.be/4zahvcJ9glg (pt 1/2)
https://youtu.be/oOcTVTpUsPQ (pt 2/2)

My Diffie-Hellman Encryption flow:
http://llamalab.com/automate/community/flows/26307

The flow is fully functional and all calculations are random, like the real deal. This CAN be used (to create an encryption key) in Messenging flows, but it's just not secure enough to actually be trustworthy due too the small digit numbers.

#### 4.3 average rating from 12 reviews

 5 stars 9 4 stars 1 3 stars 1 2 stars 0 1 star 0 Reports 1

Rate and review within the app in the Community section.