MarionL - fixed encryption function

fixed an issue with the encryption function that was not working
properly.