fix crypt implemntation