cryptoadvance / specter-diy

DIY airgapped hardware wallet that uses QR codes for communication with the host
MIT License
440 stars 73 forks source link

Add message encryption/decryption #184

Open rabutial opened 2 years ago

rabutial commented 2 years ago

See https://github.com/nym-hackathon/ideas/issues/9

Specter DIY is a fantastic hardware platform for this idea.

stepansnigirev commented 2 years ago

Sounds doable. We are adding extensions support soon, and processing of nym messages can be one of the extensions. Are there any specs on the message format and cryptographic algorithms used in the protocol?

rabutial commented 2 years ago

Sounds doable. We are adding extensions support soon, and processing of nym messages can be one of the extensions. Are there any specs on the message format and cryptographic algorithms used in the protocol?

I've asked someone from the Nym team to provide an authoritative answer.

rabutial commented 2 years ago

@stepansnigirev It probably makes the most sense to focus on offline encryption/decryption of messages, rather than trying to do all the network-related cryptography offline.

That means we would be focused on interfacing to e.g https://github.com/sgeisler/nym-chat -- which appears to be the intended (but not yet finished) chat client for the Nym network.

At the moment the message format given here is probably too simple and will no doubt grow complications as development progresses.

At the moment, the plaintext format is:

The ciphertext format is:

Encryption/decryption is handled by the aes_gcm library, and that's really all there is to it.

Since the Nym chat client is in a very rudimentary state, I also added a note for Catchat that they may want to consider supporting this. My understanding is the Katzenpost mixnet-based Catchat (as opposed to the Nym mixnet-based nym-chat) is in a much more advanced state of development.

rabutial commented 2 years ago

Sounds doable. We are adding extensions support soon, and processing of nym messages can be one of the extensions. Are there any specs on the message format and cryptographic algorithms used in the protocol?

Hi Stepan, there has been some discussion about this in the Catchat issue. The Catchat maintainers have some questions about Specter DIY's capabilities and interfaces. When you get some time, please take a look at that issue and reply there: https://github.com/katzenpost/catchat/issues/58#issuecomment-1060630993