@@ -0,0 +1,1415 @@
+package de.uni.trier.infsec.protocols.simplevoting;%0A%0Aimport de.uni.trier.infsec.environment.network.Network;%0Aimport de.uni.trier.infsec.environment.network.NetworkError;%0Aimport de.uni.trier.infsec.functionalities.pkenc.ideal.Decryptor;%0Aimport de.uni.trier.infsec.functionalities.pkenc.ideal.Encryptor;%0A%0A%0A// Creates one client and make her vote.%0A//%0Apublic class ClientOnlySetup %7B%0A%09%0A%09static private boolean secret = false; // SECRET -- an arbitrary value put here%0A%0A%09public static void main(String args%5B%5D) throws NetworkError %0A%09%7B%09%0A%09%09// generate keys: %0A%09%09Decryptor voterDec = new Decryptor();%0A%09%09Encryptor voterEnc = voterDec.getEncryptor();%0A%09%09Decryptor serverDec = new Decryptor();%0A%09%09Encryptor serverEnc = serverDec.getEncryptor();%0A%09%0A%09%09// publish public keys:%0A%09%09Network.networkOut(serverEnc.getPublicKey());%0A%09%09Network.networkOut(voterEnc.getPublicKey());%0A%09%09%0A%09%09// determine the value the client encrypts:%0A%09%09byte vote1 = Network.networkIn()%5B0%5D; // the adversary gives two values (bytes)%0A%09%09byte vote2 = Network.networkIn()%5B0%5D;%0A%09%09byte vote%5B%5D = new byte%5B1%5D; %0A%09%09vote%5B0%5D = secret ? vote1 : vote2;    // and one of them is picked as the vote (depending on the value of the secret bit)%0A%09%09%0A%09%09// let the adversary determine the credential (even in this case the voter choice should remain secret)%0A%09%09byte%5B%5D credential = Network.networkIn();%0A%09%09%0A%09%09Voter voter = new Voter(voterDec, credential, serverEnc, vote);%0A%09%09voter.vote();%0A%09%7D%0A%7D%0A

add simple setup for client only