Cryptool icon indicating copy to clipboard operation
Cryptool copied to clipboard

Key exchange feature

Open Aseel67 opened this issue 1 year ago • 3 comments

Will Silence's key exchange feature work with this app?

Aseel67 avatar Jul 28 '24 21:07 Aseel67

Could you give more details about your idea? Maybe an example, or a sketch, so we can discuss the idea here before to add it to the roadmap.

nfdz avatar Jul 29 '24 14:07 nfdz

Silence's key exchange feature

Silence is known for using End-to-End Encryption to protect messages between users. Key exchange is an essential part of this process, allowing users to send and receive messages securely by generating and exchanging encryption keys. How key exchange works:

Generate two keys:
    Each party creates a pair of keys: A public key and a private key.
    The public key is shared with others, while the private key is kept secret.

Public key exchange:
    When starting a new conversation, each party sends their public key to the other party. This can be done via an initial unencrypted message or through a secure medium.

Generate the shared key:
    Using the public key received, each party generates a shared encryption key using a technique such as Diffie-Hellman key exchange.
    This shared key is used to encrypt and decrypt messages.

[User A] [User B] | | Generates <---- Generates Public/Private Public/Private Key Pair Key Pair | | Sends Public Key --> Receives Public Key | | Receives Public Key <-- Sends Public Key | | Creates Shared Key Using with User B's Public User B's Public Key Key and Own Private and Own Private Key Key | | | Uses Shared Key for Uses Shared Key for Securing Messages Securing Messages

Practical example:

  • Alice and Bob choose the same Silence app to chat.
  • Alice sends the first unencrypted message containing her public key to Bob.
  • Bob reads the message and receives the public key, then responds with a message containing his public key.
  • After exchanging public keys, Alice and Bob can each generate a shared key using the other party's public key.
  • From now on, all messages are encrypted using the shared key, ensuring the confidentiality of communications.

The source code for the app "Silence"

https://git.silence.dev/Silence/Silence-Android

Aseel67 avatar Jul 29 '24 15:07 Aseel67

Users are guided through the ECDH handshake https://cryptobook.nakov.com/asymmetric-key-ciphers/ecdh-key-exchange.

A secure key is then generated and linked to a colleague's phone number; 256-bit agreement keys are generated for this - ~91 bytes to be sent via SMS It becomes the first RK to be sent - and thus begins the era of key chains. You'll have to read this attached file to see if you can implement this in the application. doubleratchet.pdf

https://signal.org/docs/specations/doubleratchet/.

Aseel67 avatar Jul 29 '24 15:07 Aseel67