Implement simple encrypt utility.

The salt generation bits are borrowed from OpenBSD passwd(1)'s pwd_gensalt.