It's been on my mind I wanted to get to understand a few things…
1. #COSE : #CBOR Object Signing and Encryption
2. #X25519KeyExchange
There are a few applications I have in mind for this and I could find no good examples. So, I sat down and nutted out this:
https://gist.github.com/sjlongland/fc2e06cb47543e977440b79d6cf71185
This is a simple demonstration of X25519 and COSE in #Python. The idea being that this allows two peers to mutually authenticate, then establish a shared secret.
I'm still not 100% certain of some X25519 key exchange details, specifically why pycryptography's example does it twice?
https://cryptography.io/en/latest/hazmat/primitives/asymmetric/x25519/#exchange-algorithm
Note: they generate `derived_key`, but never use it. It'd make sense if it were part of the second call to `HKDF` or something, but the result is simply thrown away. Anyone know why that is?
Anyway, maybe the #cryptography gurus might have some ideas, and whether my little toy here actually would work for decent secure comms, or if there's a gaping hole I should look out for.