From c155c2ffb898bd75f21705f520b102333331288a Mon Sep 17 00:00:00 2001
From: mwh1g17 <mwh1g17@soton.ac.uk>
Date: Sat, 2 May 2020 18:47:13 +0100
Subject: [PATCH] Key Exchange Protocol

---
 Scyther Files/KeyExchange.spdl | 41 ++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 Scyther Files/KeyExchange.spdl

diff --git a/Scyther Files/KeyExchange.spdl b/Scyther Files/KeyExchange.spdl
new file mode 100644
index 0000000..c571a44
--- /dev/null
+++ b/Scyther Files/KeyExchange.spdl	
@@ -0,0 +1,41 @@
+
+hashfunction  hashed;
+
+protocol KeyExchange(Monitor,CloudServer)
+{
+	role Monitor
+
+	{
+
+		fresh MonitorValue  : Nonce;
+		var CloudServerValue : Nonce;
+
+		send_1(Monitor,CloudServer,{Monitor,MonitorValue}pk(CloudServer));
+		recv_2(CloudServer,Monitor, {CloudServerValue,hashed(MonitorValue),CloudServer}pk(Monitor));
+		send_3(Monitor,CloudServer, hashed(CloudServerValue));
+		
+		claim_Monitor1(Monitor,Niagree);
+		claim_Monitor2(Monitor,Nisynch);
+		claim_Monitor3(Monitor,  Secret, MonitorValue);
+		claim_Monitor4(Monitor,  Secret, CloudServerValue);
+
+	}	
+	
+	role CloudServer
+
+	{
+
+		var MonitorValue: Nonce;
+		fresh CloudServerValue: Nonce;
+
+		recv_1(Monitor,CloudServer,{Monitor,MonitorValue}pk(CloudServer));
+		send_2(CloudServer,Monitor, {CloudServerValue,hashed(MonitorValue),CloudServer}pk(Monitor));
+		recv_3(Monitor,CloudServer, hashed(CloudServerValue));
+
+		claim_CloudServer1(CloudServer,Niagree);
+		claim_CloudServer2(CloudServer,Nisynch);
+		claim_CloudServer3(CloudServer,  Secret, MonitorValue);
+		claim_CloudServer4(CloudServer,  Secret, CloudServerValue);
+
+	}
+}
-- 
GitLab