Fix inconsistent use of encrypt method