I am starting to work on a Vernam cipher in Python and apparently there is something I do not know about working with binary in Python, for exmple if I print 00011
in console it returns a 9
.
"""Sistema de Cifrado Vernam"""
#alfabeto
alfabeto = {"a":00011,"b":11001,"c":01110,"d":01001,"e":00001,"f":01101,"g":11010,"h":10100,"i":00110,"j":01011,"k":01111,"l":10010,"m":11100,
"n":01100,"o":11000,"q":10111,"r":01010,"s":00101,"t":10000,"u":00111,"v":11110,"w":10011,"x":11101,"y":10101,"z":10001,
"<":01000,"=":00010,"fdown":11111,"fup":11011," ":00100, "":00000}
"""Mensaje en texto plano"""
#Susituir por input
mensaje = "stack"
m = []
for e in mensaje:
m.append(alfabeto[e])
print m
Output
[65, 10000, 9, 584, 585]
I want to print the actual binary numbers insted of the ASCII version.