diff --git a/Documentation.doc b/Documentation.doc new file mode 100644 index 0000000..b686b9d Binary files /dev/null and b/Documentation.doc differ diff --git a/main.sagews b/main.sagews index f53b2dd..8ec7a94 100644 --- a/main.sagews +++ b/main.sagews @@ -32,20 +32,10 @@ for i in range(m): print "Public Key is: ",PK #ENCRYPTION-------------------------------------------- -Keyboard=[' ','!','"','#','$'] -BinaryKeyboard=["00100000","00100001","00100010","00100011","00100100"] - -test="!" -index=0 -for i in range(len(test)): - if(test[i]==Keyboard[i]): - index=i - test=Keyboard[index] -print test - -#A message in binary -Message=[0,1,1,0,1,0,1,1,0,0] -Messagelength=10 +#Message to binary +Amessage="A message" +Message=' '.join(format(ord(x), 'b') for x in Amessage) +Messagelength=len(Message) #EncryptedMessage matrix initialization EncryptedMessage=matrix(Messagelength,n+1) @@ -72,21 +62,10 @@ for i in range(Messagelength): S[ci,l]=PK[rand,l] print "Random Set is: ",S print "----------------------" - sumOfB=0 #this is the variable that will hold the sum of b,of last column for k in range(n+1): for j in range(Ssize): #In each column of EncryptedMessage, the sum of A parameters of each of column of S is entered,except for the last one - if(k