finisihed encrypts function