[plt-scheme] crypt() implementation?

From: Pat Ekman (pat at ekman.cx)
Date: Fri Aug 15 01:35:58 EDT 2003

Quoth Matthew Flatt on Thursday, August 14, 2003:
> Does anyone have an implementation of the Unix crypt() function (that
> doesn't involve calling out to the C implementation)? Or something that
> does the same job at least as well?

Do you mean you want a pure Scheme implementation, or can it be in C as
long as it doesn't depend on crypt()?

If it's the former, here's a pure Scheme implementation of MD5 which,
with the addition of a random salt, would work fine for password


If it's the latter, there are a few possibilities.  You could use the
crypt() source code from one of the BSDs.  OpenBSD's version looks like
a good candidate:


Or you could use one of the hash libraries on the Libraries and
Extensions page.  The Digest library implements MD5, is self contained,
but needs to be updated for 205.  The mhash wrapper that I contributed
implements all sorts of hash algorithms, but requires an external C

Pat Ekman

Posted on the users mailing list.