Modify encryption to protect against edge cases