remove for loop in sessionkey encryption