new SecretKey-Alice : key in new SecretKey-Bob : key in new Send-Alice-Bob : msg in new Send-Bob-Alice : msg in new Recv-Alice-Bob : msg in new Recv-Bob-Alice : msg in
-
In symmetric-key encryption, the sender (Alice) and the receiver (Bob) need to agree on a shared secret key. One such key-agreement protocol is the Diffie-Hellman Key Exchange (DHKE). We then use the Diffie-Hellman Key Exchange protocol to turn an authenticated channel into a one-time pad that delivers a single secret message from Alice to Bob.
new SecretKey-Alice : key in new SecretKey-Bob : key in new Send-Alice-Bob : msg in new Send-Bob-Alice : msg in new Recv-Alice-Bob : msg in new Recv-Bob-Alice : msg in
new OkKey-AliceAdvId : msg in new OkKey-BobAdvId : msg in
new SharedKey : msg in
new SecretKey-Alice : key in new SecretKey-Bob : key in new PublicKey-Alice : msg in new PublicKey-Bob : msg in
( SecretKey-Alice ::= samp unif_keydistribution unif_key : unit -> key(()) )
( SecretKey-Alice ::= samp unif_keydistribution unif_key : unit -> key(()) )
( Send-Alice-Bob ::= ka : key <- read SecretKey-Alice ; return expfunction exp : msg * key -> msg( (gfunction g : unit -> msg(()), ka) ) )
( PublicKey-Alice ::= ka : key <- read SecretKey-Alice ; return expfunction exp : msg * key -> msg( (gfunction g : unit -> msg(()), ka) ) )
( LeakPublicKey-AliceAdvNet ::= sa : msg <- read Send-Alice-Bob ; return sa )
( LeakPublicKey-AliceAdvNet ::= pka : msg <- read PublicKey-Alice ; return pka )
( Key-Alice ::= rb : msg <- read Recv-Bob-Alice ; ka : key <- read SecretKey-Alice ; return expfunction exp : msg * key -> msg( (rb, ka) ) )
( Key-Alice ::= oka : msg <- read OkKey-AliceAdvId ; sk : msg <- read SharedKey ; return sk )
( OkKey-AliceAdvId ::= ob : msg <- read OkPublicKey-BobAdvNet ; return ob )
( SecretKey-Bob ::= samp unif_keydistribution unif_key : unit -> key(()) )
( SecretKey-Bob ::= samp unif_keydistribution unif_key : unit -> key(()) )
( Send-Bob-Alice ::= kb : key <- read SecretKey-Bob ; return expfunction exp : msg * key -> msg( (gfunction g : unit -> msg(()), kb) ) )
( PublicKey-Bob ::= kb : key <- read SecretKey-Bob ; return expfunction exp : msg * key -> msg( (gfunction g : unit -> msg(()), kb) ) )
( LeakPublicKey-BobAdvNet ::= sb : msg <- read Send-Bob-Alice ; return sb )
( LeakPublicKey-BobAdvNet ::= pkb : msg <- read PublicKey-Bob ; return pkb )
( Key-Bob ::= ra : msg <- read Recv-Alice-Bob ; kb : key <- read SecretKey-Bob ; return expfunction exp : msg * key -> msg( (ra, kb) ) )
( Key-Bob ::= okb : msg <- read OkKey-BobAdvId ; sk : msg <- read SharedKey ; return sk )
( OkKey-BobAdvId ::= oa : msg <- read OkPublicKey-AliceAdvNet ; return oa )
( SharedKey ::= samp unif_msgdistribution unif_msg : unit -> msg(()) )