-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Implementing cryptographic schemes in sage.crypto
#37305
Comments
sage.crypto
sage.crypto
I don't have an opinion on how this should be implemented in Sage, but as someone who has used Sage to prototype new cryptographic schemes before, I do think something like this would be nice to have. I think it would be nice if Sage implemented "toy" implementations (i.e. minimal effort put towards things like side-channel resistance, and not intended for real-world encryption use) of well-known cryptographic schemes (RSA, ECDH, and some of the new post-quantum schemes that are being standardized) to provide something to compare against for correctness if someone is trying to implement some well-known scheme with some improved algorithm. |
…ellman Motivated by (but does not yet close) sagemath#37305. Closes sagemath#11568. This PR adds a basic framework to add public key exchange schemes to Sage, and includes an implementation of the Diffie-Hellman primarily as an example of this new framework. Open to suggestions to improve the structure of the code. This code was based on the existing code for public-key encryption in Sage. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies None URL: sagemath#38374 Reported by: Vincent Macri Reviewer(s): grhkm21, grnx, Vincent Macri
…ellman Motivated by (but does not yet close) sagemath#37305. Closes sagemath#11568. This PR adds a basic framework to add public key exchange schemes to Sage, and includes an implementation of the Diffie-Hellman primarily as an example of this new framework. Open to suggestions to improve the structure of the code. This code was based on the existing code for public-key encryption in Sage. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies None URL: sagemath#38374 Reported by: Vincent Macri Reviewer(s): grhkm21, grnx, Vincent Macri
Problem Description
As it is right now,
sage.crypto
does not have too many advanced features especially outside symmetric cryptanalysis. It would be great to improve on that.Proposed Solution
I propose to include implementation of popular and basic cryptography primitives/schemes in that directory. It can serve as a reference implementation, and also help cryptographers prototype new advanced protocols easier.
For basic primitives, there are two directions. One direction is the "structural" side, for example creating classes for encryption schemes, OT, commitment schemes and others. The other direction is the "implementation" side, for example implementing a basic scheme using those classes.
Take encryption schemes as a concrete example. A class for a public key encryption scheme would have methods like
.generate_key
,.encrypt(msg, pk)
,.decrypt(msg, sk)
. An implementation can simply be wrapping around AES.What do everyone think? Any strong opinion on whether to include this or not?
The text was updated successfully, but these errors were encountered: