crypt implementation