Repository navigation
X25519 Support - #3686
X25519 Support#3686
Conversation
|
|
||
| :returns: :class:`X25519PublicKey` | ||
|
|
||
| .. method:: private_bytes() |
There was a problem hiding this comment.
I thought we agreed that private_bytes wasn't needed?
There was a problem hiding this comment.
We did! And everywhere but the docs I removed it. Missed this one!
|
|
||
| .. versionadded:: 2.0 | ||
|
|
||
| .. classmethod:: from_public_bytes(data) |
There was a problem hiding this comment.
Let's add an example of generating a private key, and then round tripping its public key.
| UNSUPPORTED_X509 = 8 | ||
| UNSUPPORTED_EXCHANGE_ALGORITHM = 9 | ||
| UNSUPPORTED_DIFFIE_HELLMAN = 10 | ||
| UNSUPPORTED_X25519 = 11 |
There was a problem hiding this comment.
Why not just use one of the two existing relevant reasons?
| # This is the standard PKCS8 prefix for a 32 byte X25519 key. | ||
| # The form is: | ||
| # (SEQUENCE INTEGER ALGORITHMIDENTIFIER OCTETSTRING) | ||
| pkcs8_prefix = b'0.\x02\x01\x000\x05\x06\x03+en\x04"\x04 ' |
There was a problem hiding this comment.
This could probably use a longer comment, expanding on the ASN.1 parsing. Not everyone likes to parse it by hand (although I did)
| ] | ||
| ) | ||
| def test_public_bytes(self, private_bytes, public_bytes, backend): | ||
| private_key = X25519PrivateKey._from_private_bytes(private_bytes) |
| b"8520f0098930a754748b7ddcb43ef75a0dbf3a0d26381af4eba4a98" | ||
| b"eaa9b4e6a" | ||
| ) | ||
| ], |
|
@reaperhulk: is there a reason why it was not designed the API for serializing private bytes? Is there any internal that helps in case this is needed? |
|
@evilaliv3 #4386 exists to track that issue. If you wouldn't mind writing up your use case that will help us when deciding how to prioritize our dev efforts. |
|
Actually many software implementations are using the key for more than just
key exchange (ecdh) but as well for encryption. This includes openssh and
openpgp.js for example as an alternative for NIST keys.
Is there a specific consideration you specifically implemented it only for
key exchange?
We are evaluating it in globaleaks where to implement a protocol similar to
WhatsApp/signal that also uses and store keys generated with this curve
…On Tue, Aug 28, 2018, 16:55 Paul Kehrer ***@***.***> wrote:
@evilaliv3 <https://github.com/evilaliv3> #4386
<#4386> exists to track that
issue. If you wouldn't mind writing up your use case that will help us when
deciding how to prioritize our dev efforts.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3686 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AANPypuQAm7R6Y612RnRyvp_EKSPLNpEks5uVVn7gaJpZM4Nw54P>
.
|
|
Presumably they're using X25519 for ECIES encryption since that's a DH kex? X25519 is explicitly specified for key exchange, which is why we have it exposed in that fashion. People using it to build ECIES constructions is an interesting use case and provides some form of rationale for having non-ephemeral keys. If you could put this info on #4386 that would be helpful, thanks. |
|
Exactly, thanks!
In the meantime is there any way using internals of python-cryptography to
reach and export the key?
|
|
There's no way to export right now without using the C bindings themselves unfortunately. You'd need to use |
depends on #3685 and #3684 and fixes #3590