Remove trailing \n when encrypting string