Skip to content

c6ai/c6ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 

Repository files navigation

%%{init: {'themeVariables': {'fontFamily': 'Bernard MT Condensed', 'fontSize': '24px','fontWeight': 'bold'}}}%%
sequenceDiagram
    participant Alice as πŸ‘© Alice
    participant Bob as πŸ‘¨ Bob
    participant Server as πŸ’» Server

    rect rgb(200, 220, 255)
        note over Alice: Step 1
        Alice ->> Alice: πŸ‘© generates private key a πŸ”
        Bob ->> Bob: πŸ‘¨ generates private key b πŸ”
    end

    rect rgb(200, 220, 255)
        note over Alice: Step 2
        Alice ->> Alice: πŸ‘© computes public key A = g^a mod p πŸ”‘
        Alice ->> Bob: πŸ‘© sends public key A to πŸ‘¨ βœ‰οΈ
    end

    rect rgb(200, 220, 255)
        note over Bob: Step 3
        Bob ->> Bob: πŸ‘¨ computes public key B = g^b mod p πŸ”‘
        Bob ->> Alice: πŸ‘¨ sends public key B to πŸ‘© βœ‰οΈ
    end

    rect rgb(200, 220, 255)
        note over Alice, Bob: Step 4
        Alice ->> Alice: πŸ‘© computes shared secret s = B^a mod p = g^(ab) mod p πŸ”
        Bob ->> Bob: πŸ‘¨ computes shared secret s = A^b mod p = g^(ab) mod p πŸ”
    end

    rect rgb(200, 220, 255)
        note over Alice, Server: Step 5
        Alice ->> Server: πŸ‘© sends encrypted message to Server πŸ’»: {Alice, Bob, s} βœ‰οΈ
        Bob ->> Server: πŸ‘¨ sends encrypted message to Server πŸ’»: {Alice, Bob, s} βœ‰οΈ
    end

    rect rgb(200, 220, 255)
        note over Server: Step 6
        Server ->> Server: πŸ’» matches secrets received from πŸ‘© and πŸ‘¨
        Server ->> Server: πŸ’» generates session key Ks πŸ”
        Server ->> Alice: πŸ’» sends session key Ks to πŸ‘© βœ‰οΈ
        Server ->> Bob: πŸ’» sends session key Ks to πŸ‘¨ βœ‰οΈ
    end

    rect rgb(200, 220, 255)
        note over Alice, Bob: Step 7
        Alice ->> Alice: πŸ‘© receives session key Ks from Server πŸ”
        Bob ->> Bob: πŸ‘¨ receives session key Ks from Server πŸ”
    end

    rect rgb(200, 220, 255)
        note over Alice, Bob: Result
        Alice ->> Bob: πŸ‘© πŸ‘¨ can now communicate securely using session key Ks πŸ”
    end
Loading

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published