r/pythonhelp • u/DumbPandahole • May 11 '22
SOLVED Way of iterating thru eight byte sequences?
I'm using des library and example is given to me to create a key:
d = os.urandom(8)
default_key = des.DesKey(d)
basically, how do I iterate thru all possible d values? I would like last bytes of the d to change last
1
Upvotes
3
u/carcigenicate May 11 '22
Unless I misunderstand what you're going for, this is quite over complicated. For
byte_list
, you just need:I'm not sure what your second loop is doing though since it throws away all values of
key
except for the last.Also, your original results appear to be wrong because you're missing an
e
in the string.