fixed most of encrypt memory leaks, 11 leaks left