Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Playfair Cipher by TovarischZhukov
import string
NUM = 6
def find(matrix, val, pos1=None, pos2=None):
for i in range(NUM):
for j in range (NUM):
if matrix[i][j]==val[0]:pos1=(i,j)
if matrix[i][j]==val[1]:pos2=(i,j)
return (pos1, pos2)
def getMatrix(message, str_common, key):
matrix=[]; tmp_str= ""
for val in key:
if val in str_common and val not in tmp_str:
tmp_str+=val; str_common.remove(val)
for i in range(NUM):
matrix.append([])
for j in range(NUM):
pos=i*NUM+j
if pos
Jan. 25, 2016