X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=doc%2Fhandshake.txt;h=50b479a56293daefb44b1daccda4e1009485598a;hb=2f3299c343b4036718f254d9c23f147ba1bc0161;hp=d946833876e7a2d052b1367100fe3a2655551eef;hpb=71d699f1c4aa8e2a8537e2d63222faec0a6ea6ca;p=govpn.git diff --git a/doc/handshake.txt b/doc/handshake.txt index d946833..50b479a 100644 --- a/doc/handshake.txt +++ b/doc/handshake.txt @@ -1,21 +1,35 @@ @startuml +hide footbox participant Client participant Server -Client -> Client : R=rand(64bit) -Client -> Client : CPrivKey=rand(256bit) -Client -> Server : R, enc(PSK, R, CPubKey), xtea(ID, R) -Server -> Server : SPrivKey=rand(256bit) -Server -> Server : K=DH(SPrivKey, CPubKey) -Server -> Server : RS=rand(64bit) -Server -> Server : SS=rand(256bit) -Server -> Client : enc(PSK, R+1, SPubKey); enc(K, R, RS+SS) -Client -> Client : K=DH(CPrivKey, SPubKey) -Client -> Client : RC=rand(64bit); SC=rand(256bit) -Client -> Server : enc(K, R+1, RS+RC+SC) -Server -> Server : compare(RS) -Server -> Server : MasterKey=SS XOR SC -Server -> Client : enc(K, 0x00, RC) -Client -> Client : compare(RC) -Client -> Client : MasterKey=SS XOR SC +Client -> Server : R, enc(H(DSAPub), R, El(CDHPub)) +note right +R=rand(64bit) +CDHPriv=rand(256bit) +end note + +Server -> Client : enc(H(DSAPub), R+1, El(SDHPub))\nenc(K, R, RS+SS) +note right +SDHPriv=rand(256bit) +K=H(DH(SDHPriv, CDHPub)) +RS=rand(64bit) +SS=rand(256bit) +end note + +Client -> Server : enc(K, R+1, RS+RC+SC+Sign(DSAPriv, K)) +note right +K=H(DH(CDHPriv, SDHPub)) +RC=rand(64bit) +SC=rand(256bit) +end note + +Server -> Client : enc(K, R+2, RC) +note right +compare(RS) +compare(RC) +Verify(DSAPub, Sign(DSAPriv, K), K) +MasterKey=SS XOR SC +end note + @enduml