Added CRYPT supprt to hash generator function.