Question: [ Protocol ] Simulate the protocol in the file Driver.java. To help you with this problem, here is a sample session: > java Driver Usage:
Protocol Simulate the protocol in the file Driver.java. To help you with this problem, here is
a sample session:
java Driver
Usage: java Driver BBSp BBSq RSAAlicep RSAAliceq RSABobp RSABobq DHq
java Driver
Setting up BBS with p and q
n
s
Setting up DH with q
alpha
Alices side
p q n phin e d
Ra
Xa
Ya
Bobs side
p q n phin e d
Rb
Xb
Yb
EPUaRa
EPRbEPUaRa
EPUaYb
EPRbEPUaYb
Alices side
Decrypted Ra
Decrypted Yb
K
EPUbRb
EPRaEPUbRb
EPUbYa
EPRaEPUbYa
Bobs side
Decrypted Rb
Decrypted Ya
K
class Driver
complete the following method to simulate the protocol given in
the handout and match the output listed in the handout. You
must modify ALL and ONLY the lines marked with a "modify"
comment.
public static void mainString args throws Exception
if argslength
System.out.printlnUsage: java Driver BBSp BBSq RSAAlicep
"RSAAliceq RSABobp RSABobq DHq;
System.exit;
Primes.loadPrimes;
inputs for BBS computations
in this simulation, the BBS instance is shared by Alice and Bob
int BBSp Integer.parseIntargs;
int BBSq Integer.parseIntargs;
BBS bbs new BBSBBSpBBSq;
inputs for publicprivate key pair computations
int RSAap Integer.parseIntargs;
int RSAaq Integer.parseIntargs;
int RSAbp Integer.parseIntargs;
int RSAbq Integer.parseIntargs;
input for DiffieHellman computations
int DHq Integer.parseIntargs;
System.out.printlnSetting up DH with q DHq;
int alpha Primes.pickAlphaDHq;
System.out.printlnalpha alpha;
System.out.println Alice's side ;
RSA RSAa new RSARSAap RSAaq;
int Ra ; modify: random integer
System.out.printlnRa Ra;
int Xa DHq ;
System.out.printlnXa Xa;
int Ya ; modify: first step in Diffie Hellman
System.out.printlnYa Ya;
System.out.println Bob's side ;
RSA RSAb new RSARSAbp RSAbq;
int Rb ; modify: random integer
System.out.printlnRb Rb;
int Xb DHq ;
System.out.printlnXb Xb;
int Yb ; modify: second step in Diffie Hellman
System.out.printlnYb Yb;
encrypt and sign Ra
int EPUaRa ; modify: encrypt step
int EPRbRa ; modify: sign step
System.out.printlnEPUaRa EPUaRa;
System.out.printlnEPRbEPUaRa EPRbRa;
encrypt and sign Yb
int EPUaYb ; modify: encrypt step
int EPRbYb ; modify: sign step
System.out.printlnEPUaYb EPUaYb;
System.out.printlnEPRbEPUaYb EPRbYb;
System.out.println Alice's side ;
int RaDec ; modify: value decrypted by Alice
System.out.printlnDecrypted Ra RaDec;
int YbDec ; modify: value decrypted by Alice
System.out.printlnDecrypted Yb YbDec;
int K ; modify: compute session key with Diffie Hellman
System.out.printlnK K;
encrypt and sign RB
int EPUbRb ; modify: encrypt step
int EPRaRb ; modify: sign step
System.out.printlnEPUbRb EPUbRb;
System.out.printlnEPRaEPUbRb EPRaRb;
encrypt and sign Yb
int EPUbYa ; modify: encrypt step
int EPRaYa ; modify: sign step
System.out.printlnEPUbYa EPUbYa;
System.out.printlnEPRaEPUbYa EPRaYa;
System.out.println Bob's side ;
int RbDec ; modify: value decrypted by Bob
System.out.printlnDecrypted Rb RbDec;
int YaDec ; modify: value decrypted by Bob
System.out.printlnDecrypted Ya YaDec;
K ; modify: compute session key with Diffie Hellman
System.out.printlnK K;
main method
Driver class
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
