#Dayoon Kim, 2024-4-21, HW24 Help:=proc(): print(` AliceToBob(M,Nbob,eBob,Nalice,dAlice,H), BobReadAlice(MS,Nbob,dBob,Nalice,eAlice,H) `): print(` AliceT `): end: #HW24-1. print(` [8] `); #HW24-2. #AliceToBob(M,Nbob,eBob,Nalice,dAlice,H):| AliceToBob:=proc(M,Nbob,eBob,Nalice,dAlice,H) local x,M1,S: M1:=M&^eBob mod Nbob: x:=M&^3 mod H: S:=x&^dAlice mod Nalice: [M1,S]: end: #BobReadAlice(MS,Nbob,dBob,Nalice,eAlice,H) #inputs a signed message MS=[M1,S] sent from Alice, #Nbob,dBob,Nalice, eAlice, and H outputs #the deciphered message from Alice and also checks #that it came from Alice and not from a bad guy #pretending to be Alice BobReadAlice:=proc(MS,Nbob,dBob,Nalice,eAlice,H) local M1,S,M,X,X1: M1:=MS[1]: S:=MS[2]: M:=M1&^dBob mod Nbob: X:=M&^3 mod H: X1:=S&^eAlice mod Nalice: if X<>X1 then print(`You are not Alice, I will call the police`): fi: M: end: #HW24-3. #1. my key: #MakeRSAkey(10,100); #[N,e,d]:=[1883925284252198456411, 489703529340811966481, 789424458785472270041] #H:=94380271871 #2. JOSEPH K sent RSA public key: #N := 1566257182390879657957: #e := 962437938162041021459: # Also, NURAY K sent RSA public key: #N:= 468904957950013467496814665250009902732699 #e:= 338284290575781482185519661165079134629261 #3. I sent to JOSEPH K #MS := [1123155140306324520425, 183765706050434746205] #What's my birthday, and do you believe it's me? #Also, I sent NURAY #MS := [174942331535290281251671604437579603069411, 183765706050434746205] #What's my birthday, and do you believe it's me? #4. JOSEPH K sent me #Thanks for sending! I think that your birthday is 7/02/1996 and I believe it's you. #Also, NURAY sent me #07/02/1996 is your birthday, and you are in fact Dayoon!