Fixing issue with conversion between lists and ints, and only trimming padding character at the end of decrypted text