Convert Bytes to Matrix in Python

Converting bytes to int is easily done by int.from_bytes method in python.

- https://cryptohack.org/courses/symmetric/aes2/

Conversion

text = b"helloworld!!"
column = 4

print([list(text[i:i+column]) for i in range(0, len(text), oolumn)])
# Output
[[104, 101, 108, 108], [111, 119, 111, 114], [108, 100, 33, 33]]