Post Reply 
(38G) Hill's Encryption System
03-04-2017, 03:32 PM
Post: #2
RE: HP 38G: Hill's Encryption System
Sorry, the programme HILLSET did not set up M0 efficiently, here is a more efficient version, the difference being in the line with the command "BREAK":

Code:

 INPUT C;"Hill Cryptosystem"; "Modulus";" Cypher Modulus ► C";26:
 INPUT S;"Hill Cryptosystem"; "Size";" Size of Cypher Matrix ► S";4:
 IDENMAT(S)►M0:
 FOR I=1 TO S STEP 1;
 FOR J=1 TO S STEP 1;
 IF I==J
 THEN
 IF RANDOM>.5
 THEN
-1►M0(I,I):
 END:
 BREAK:
 ELSE
 INT(C*(RANDOM))►M0(I,J):
 END:
 END:
 END: 
 M0:
 Ans*TRN(Ans):
 MAKEMAT(Ans(I,J)MOD C,S,S
 )►M9:
 M0^-1:
 MAKEMAT(
 ROUND(Ans(I,J),0),S,S):
 TRN(Ans)*Ans:
 MAKEMAT(Ans(I,J)MOD C,S,S
 )►M0:
 MAKEMAT(INT(C*RANDOM),1,S)►M8:
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(38G) Hill's Encryption System - Gerald H - 10-01-2015, 10:16 AM
RE: HP 38G: Hill's Encryption System - Gerald H - 03-04-2017 03:32 PM



User(s) browsing this thread: 1 Guest(s)