Coder Social home page Coder Social logo

Add DSA about cryptography HOT 10 CLOSED

pyca avatar pyca commented on September 17, 2024
Add DSA

from cryptography.

Comments (10)

alex avatar alex commented on September 17, 2024

First hard API design question:

RSAPrivateKey objects have a public_key method which returns an RSAPublicKey. Presumably we'd like to have the same on DSAPrivateKey. Unfortunately DSA keys contain a member (y) which is also typically known by public_key.

It seems we have three choices:

  • Be inconsistent with typical naming conventions around DSA
  • Be inconsistent with the RSA API
  • Change the RSA API as well

Opinions?

from cryptography.

public avatar public commented on September 17, 2024

What APIs call only the bare y a public key?

Seems like public_key should return a DSAPublicKey and that y parameter should just be y to me.

from cryptography.

reaperhulk avatar reaperhulk commented on September 17, 2024

It'd be nice to store the DSA params as an object, which then makes DSAPublicKey a more useful object.

private_key = dsa.DSAPrivateKey.generate(2048, backend)
params = private_key.params()
public_key = private_key.public_key()
same_params = public_key.params()
print(params.p)
print(same_params.p)

from cryptography.

cipherself avatar cipherself commented on September 17, 2024

@reaperhulk agreed.

from cryptography.

alex avatar alex commented on September 17, 2024

@public We've typically tried to offer the more verbose name whenever possible here, PyCrypto's docs describe y as Public key (y), I haven't seen any other reference on this.

from cryptography.

cipherself avatar cipherself commented on September 17, 2024

@alex I think the to-do list needs to be updated?

from cryptography.

reaperhulk avatar reaperhulk commented on September 17, 2024

I've updated the list.

from cryptography.

cipherself avatar cipherself commented on September 17, 2024

@reaperhulk Awesome, thanks :)

from cryptography.

alex avatar alex commented on September 17, 2024

I guess we're done here.

from cryptography.

public avatar public commented on September 17, 2024

High fives all round.

from cryptography.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.