Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: RSA cryptosystem signature project #184

Merged

Conversation

vkWeb
Copy link
Member

@vkWeb vkWeb commented Jun 15, 2019

This is a simple implementation of RSA cryptosystem. The only caveat is that the implementation doesn't work with prime numbers greater than 10 like 11, 19. I have asked a question on StackOverflow to deal with this.

@scissorsneedfoodtoo This is my first JavaScript project. So, I'll be looking forward to your feedback. I would love to see ways of improving the current implementation and project design. 😃

Closes #101

@vkWeb
Copy link
Member Author

vkWeb commented Jun 15, 2019

@scissorsneedfoodtoo Actually, I realized just now, there's a small flaw in the implementation that might be the reason for prime > 10 issue. I'll fix it soon.

- Fixes issue with large primes
- Default message revised to fix minor typos
- Revised success and failure messages
@vkWeb
Copy link
Member Author

vkWeb commented Jun 17, 2019

@scissorsneedfoodtoo All issues fixed. Now, we are ready to break it down into units.

@vkWeb
Copy link
Member Author

vkWeb commented Jun 17, 2019

@scissorsneedfoodtoo I would love to see your feedback on the test descriptions written so far. How can I make it better?

@scissorsneedfoodtoo
Copy link
Contributor

@vkWeb, sure, let me take a look and make some suggestions.

rsa-cryptosystem-signature/index01.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index02.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index04.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index06.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index07.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index08.js Outdated Show resolved Hide resolved
@vkWeb
Copy link
Member Author

vkWeb commented Jun 27, 2019

@scissorsneedfoodtoo I think you should look at test descriptions to simplify challenges a bit more. I'll appreciate your feedback on ways of improving the teaching approach.

And tell me from your perspective whether campers will be able to grasp the concepts through these tests or not. This project should be a hit one ;)

@vkWeb
Copy link
Member Author

vkWeb commented Jun 28, 2019

@scissorsneedfoodtoo Do we need to break index.html and style.css into test descriptions? If yes then maybe we should turn this into a console based application to reduce unnecessary UI hassle.

@scissorsneedfoodtoo
Copy link
Contributor

@vkWeb, yes, we're pushing for learners to write much if not all of the code for these projects. Turning this project into a console based application is a good idea and would help learners focus on learning about RSA signatures.

@vkWeb
Copy link
Member Author

vkWeb commented Jun 29, 2019

@scissorsneedfoodtoo I have turned this into a console based application. The test descriptions are almost complete. I just need to revise some of them and add a bit more to illustrate hash collision.

Please provide your feedback so that I can further improve them.

rsa-cryptosystem-signature/index01.js Show resolved Hide resolved
rsa-cryptosystem-signature/index02.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index03.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index04.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index05.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index14.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index15.js Show resolved Hide resolved
rsa-cryptosystem-signature/index16.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index17.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index18.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index19.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index20.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index21.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index22.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index23.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index47.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index48.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index49.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index50.js Outdated Show resolved Hide resolved
rsa-cryptosystem-signature/index51.js Outdated Show resolved Hide resolved
@vkWeb
Copy link
Member Author

vkWeb commented Jul 14, 2019

@scissorsneedfoodtoo Here's the diagram to illustrate the signing process:
RSA signing process

☝️ How does this look? Do you feel campers will comfortably understand the process through this diagram?

@scissorsneedfoodtoo
Copy link
Contributor

scissorsneedfoodtoo commented Jul 16, 2019

@vkWeb, your diagram looks great! Makes it much easier to understand the whole process. The only suggestion I have is to alter the text slightly:

Encrypt hash value --> Encrypt the hash value using Alice's private key
Decrypt the signature --> Decrypt the signature using Alice's public key

Would you mind if I merge this as is? Any changes can be made in a future PR.

- Added a diagram to explain the signing process
- Revised all the test descriptions
- Added some descriptions to illustrate hash collision

To Do: Explain the internals of encryption and decryption equations
@vkWeb
Copy link
Member Author

vkWeb commented Jul 18, 2019

@scissorsneedfoodtoo I think now the descriptions look good. I have made some adjustments to the diagram on your advice.

RSA signing process diagram

Also, I have added some descriptions to illustrate the hash collision. Now, we only need to explain the internals of the encryption and decryption equation.

@scissorsneedfoodtoo Yes, we can merge this if you think everything looks fine. Maybe we can explain the equations in a future PR.

@scissorsneedfoodtoo, @QuincyLarson what do you think about the current state of this project? Your feedback will help me in improving this project.

@scissorsneedfoodtoo
Copy link
Contributor

@vkWeb, thank you for updating your diagram. It's much easier to reason about now that the keys are in there. I just noticed a couple of things:

  • Encrypt hash value using Alice's private key --> Encrypt the hash value using Alice's private key
  • If the hash value and decrypted signature match then the signature is authentic and the message must be from Alice only --> If the hash value and decrypted signature match, then the signature is authentic and the message can only be from Alice / If the hash value and decrypted signature match, then the signature is authentic and the message must be from Alice

I think your project is definitely headed in the right direction. A few of the later lessons still need some editing, so I'll leave comments here and they can be handled in a future PR. Other than that, I'll keep trying to learn more about how those equations so hopefully we can explain them simply and thoroughly.

@scissorsneedfoodtoo scissorsneedfoodtoo merged commit 1688669 into freeCodeCamp:master Jul 19, 2019
@vkWeb
Copy link
Member Author

vkWeb commented Jul 19, 2019

@scissorsneedfoodtoo Thanks for merging brother! 🎉

Yes, we'll keep on improving the project in future PR(s). Btw please re-open the issue #101 and move it to Coding Project Tests in the kanban board.

SomeDer pushed a commit to SomeDer/CurriculumExpansion that referenced this pull request Aug 26, 2019
* feat: RSA cryptosystem signature project

* fix: Large primes and message text

- Fixes issue with large primes
- Default message revised to fix minor typos
- Revised success and failure messages

* feat: Break into test decriptions (Part 1)

* fix: Improved and added more test decriptions

* fix: Revise and add test descriptions

* fix: Revise and add more test descriptions

* fix: Update and add more test descriptions

* fix: Improve and add more descriptions

- Added a diagram to explain the signing process
- Revised all the test descriptions
- Added some descriptions to illustrate hash collision

To Do: Explain the internals of encryption and decryption equations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Learn Cryptography By Building a Digital Signature System
2 participants