Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
StepByStep solution in Clear category for ADFGVX Cipher by Kouri
def encode(message, secret_alphabet, keyword):
'''remove punctions and maj'''
cleaned_string = list(filter(lambda char : char in 'abcdefghijklmnopqrstuvwxyz1234567890'
, message.lower()))
'''encode into the 'ADFGVX' alphabet'''
transformed_string = "".join(['ADFGVX'[secret_alphabet.index(char)//len('ADFGVX')]+'ADFGVX'[secret_alphabet.index(char)%len('ADFGVX')]
for char in cleaned_string])
'''cleaning the keyword'''
keyword = "".join(sorted({char:keyword.index(char) for char in keyword}.keys()
, key=lambda x : {char:keyword.index(char) for char in keyword}[x]))
'''split the string according to keyword'''
split_string = [transformed_string[index*len(keyword):(index+1)*len(keyword)]
for index in range(len(transformed_string)//len(keyword)+int(0
June 29, 2018
Comments: