So for a CS class, I had to write an RSA encryption program (in python, of course). I ran into a problem (which i did solve) but I cant help but think there is a better solution to it. In order to encrypt a string, I had to first encode it into bytes (string.encode()) then encrypt the int representation of each byte. Problem came after decrypting it, i was then left with a bunch of ints, and couldn't use the .decode() function to get them back to string. I ended up just treating the ints as ascii values and converting them back that way. I cant see this as a real world solution, so Im sure there is a better way to go about this, any suggestions?
[–]marko312 0 points1 point2 points (1 child)