For this hw I have created a program that first reads a message from a file called "Message" then convert it to numbers, and then to binary.
Then I create a random key with the length of the binary string (that is saved in a file), and I apply XOR.
The result is encrypted message, now I created decrypt functions, and you can read the original message.
The code is all commented to understand him better.
I leave screenshot of several runs to see how it changes the encrypted message can fit the key.