import java.util.*; import.java.math.BigInteger; class DH_Cracker { public static void main( String [] args ){ //all of these are public (see email) long Y = ...; long P = ...; long alpha = ...; long beta = ...; //these two are secret and you have to figure them out long A; long B; /** You will need to use a new method to compute q**r%n. It is called powerMod. It takes three arguments: powerMod( q, r, n). It returns a long value which is the result of taking q to the r, and then modding that with n. **/ //your cracking code goes here. See slides for hint. System.out.println( "The value of A is " + A ); System.out.println( "The value of B is " + B ); } //main static long powerMod( long q, long r, long n ){ return new BigInteger(""+q).modPow( new BigInteger(""+r), new BigInteger(""+n) ).longValue(); } //DH_Cracker