I am using sage maths (which uses Python(more or less)) to do some work involving cryptography. This involves using binary keys which you xor to generate a cipher or message. Often, the input data is nn hex and so I have to convert to binary to see what is going on. Here is an example of the kind of thing I am doing once I have my binary.
my_cip=0b01101.....
my_mes=0b0110....
ot_mes=0b011...
my_key=0b0000....
key_fn=0b00....
altcip=0b011011..
print my_key.__xor__(ot_mes).binary()
The problem is that when I use utility functions to convert ascii to binary and hex to binary, the result has any leading zeroes thrown away.
I do not know how many have been thrown away so I have been predicting how many bits should be in the result and sticking the appropriate number of zeroes on the front of the result.
Here is my question! Is there a way of forcing the leading zeroes to be included in the result of calling (for example) ?
`print Integer(0x6c73.....).binary() ?`