modify the encrypt method