nfdz / Cryptool

Cryptography Android application
Mozilla Public License 2.0
97 stars 20 forks source link

Key exchange feature #59

Open Aseel67 opened 1 month ago

Aseel67 commented 1 month ago

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

nfdz commented 1 month ago

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.

Aseel67 commented 1 month ago

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:

The source code for the app "Silence"

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

Aseel67 commented 1 month ago

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/.