reworked encrypt() w suggestions from itsnotabigtruck