Implment crypt, part are come from OpenBSD