%%{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
c6ai / aifaq Goto Github PK
View Code? Open in Web Editor NEWThis project forked from hyperledger-labs/aifaq
AI FAQ Proof-of-Concept project: it provides a chatbot that replies to the questions on Hyperledger Ecosystem
License: Apache License 2.0