Cryptography Reference
In-Depth Information
322198267702768221957464447815659664803425920162579425858987136337152043
957803039846247255965834154373962038550549430345349851187184745315084581
188882729078285545220915858184790787483769803775031226136431317486562458
350418482048617177445510205736750992758785167201864291032454946661656281
680207992840332684179070444405599563611590222800165616449226040755917391
1635634931359062322458271768089779844860822413 (mod
).
Finally, B squares this, and since he sent a 1, he checks that the lnr of ( tr ) 2 is z 2 . If you
do the computation, you will see that this is so:
n
(
tr
) 2
127475513685566725446890852720613095360327187603988651941231415853157578
331456597153209494004736210977699578916999466032456677595127519634159990
521540837957056538345106025673773524185786635004052033863289249942948679
351840188229397744858421574833317348003660917673550353744822055165736111
234512904116889272699406948842755115609086788122010131676983531175952081
153644282751762038948324143832454354255524095948364303252903127278566455
867876654842411687623918210589300351425145699108311147796242254029159776
570872196619284791816763597060378966996431439737466965332522784477229827
90267877957407209494836944774782001306385230738
z 2 (mod n ).
Java Algorithm I have written a couple of Java programs to do this kind of exchange.
Here the respondent acts as a client, sending a request for approval from the challenger,
which acts as a server. The respondent connects to the challenger, sends the values for n and
s , then generates r , z 1 , and z 2 . It sends z 1 and z 2 to the challenger, then waits for the challenge,
a 0 or a 1. It responds to the challenge, then waits for a response from the challenger, either
ā€œYā€ meaning approved, or ā€œNā€ meaning not yet approved. If the respondent is not yet
approved, it generates new values for r , z 1 , and z 2 , and begins again. Here is the Respondent
class.
import java.math.*;
import java.net.*;
import java.io.*;
import java.security.*;
public class Respondent {
static BufferedReader k=new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) throws IOException {
//Define some handy values
BigInteger zero=BigInteger.valueOf(0);
BigInteger one=BigInteger.valueOf(1);
BigInteger two=BigInteger.valueOf(2);
BigInteger three=BigInteger.valueOf(3);
BigInteger four=BigInteger.valueOf(4);
Search WWH ::




Custom Search