Demonstrating How Shor’s Algorithm Cracks the RSA Encryption Standard (POC — 4-bit Version)
We do not use the current industry standard RSA implementation but a version implemented by a fellow coder. A similar procedure will be used once million-qubit Quantum Computers become reality.
First of all — he is not cracking industry-standard RSA. He implemented a 4-bit version of RSA using Python code. I refer to Mr. Smaranjit Ghose, an extremely cool character, whom I have never met but whose work speaks for itself.
This guy actually implemented RSA for 4-bits and a demonstration of Shor’s Algorithm that cracks RSA. This is a tiny example, but the devil is in the details. And he has done a wonderful job.
You can find the full implementation here as a Jupyter Notebook.
I refactored the code into a project, ran unit tests, added console capabilities and a UI in Flutter.
Enough of the chat — this is our combined code:
That’s the source code and I’m aware that to most of us it has the meaning of ancient Greek.
I’ve tried to explain it as much as I can in the comments.
Here’s the Wiki page on RSA: https://en.wikipedia.org/wiki/RSA_(cryptosystem)
Welcome to IBM’s quantum computing library
And here’s the book on quantum computing by IBM (free): https://qiskit.org/textbook/content/ch-ex/
Now comes the coolest part:
I refactored the entire project into a monolithic project coupled with the Python code already available and added a UI in Flutter. This was the result.
This was my first serious Flutter project, and I really enjoyed the process of creating it. This was the output in Linux:
Linux Ubuntu Output
In Chrome:
Google Chrome
My system takes too long for the Android emulator to run, so I decided not to demo that.
But it will look the same. This is one of Flutter’s biggest advantages — uniform output across platforms.
Sample output:
Plain Text: Thomas
Cipher Text: 56467465150941795
Cracked Text: Thomas
Hope you enjoyed this article. Quantum computing has a large number of applications. We just need to be clever as to how to useit in its current NISQ formulation.
God bless.
Love you all!