Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SWI Prolog crypt/2 issue

1 view
Skip to first unread message

Mauro DiNuzzo

unread,
Jan 24, 2010, 10:13:48 AM1/24/10
to
Hi everybody.

I am experiencing problems with crypt/2 predicate.
Specifically, I got a "Password encryption not supported" exception. Among
other things, this makes crypt/2-based HTTP authentication unfeasible.

I am using SWI version 5.9.6 on Win32.

Any help is appreciated.
Thank you very much.

M

Jan Wielemaker

unread,
Jan 24, 2010, 11:18:22 AM1/24/10
to
On 2010-01-24, Mauro DiNuzzo <pic...@alice.it> wrote:
> Hi everybody.
>
> I am experiencing problems with crypt/2 predicate.
> Specifically, I got a "Password encryption not supported" exception. Among
> other things, this makes crypt/2-based HTTP authentication unfeasible.
>
> I am using SWI version 5.9.6 on Win32.

I think it should work fine if you use MD5 encrypted passwords, but
not using traditional Unix encryption. The docs at

http://www.swi-prolog.org/pldoc/doc_for?object=crypt%2f2

indicate how you can hash such passwords.

I'm happy to add traditional Unix passwords if you do the homework and
find me a nice plain C implementation of the hash-function with a
compatible license. If I recall well, I looked at the implementation
of crypt() in glibc, but it depended on so many other things that I
gave up. I need nice plain and portable C ...

Cheers --- Jan

William Waites

unread,
Feb 6, 2010, 7:37:39 AM2/6/10
to
On Jan 24, 4:18 pm, Jan Wielemaker <j...@hppc323.few.vu.nl> wrote:
> I'm happy to add traditional Unix passwords if you do the homework and
> find me a nice plain C implementation of the hash-function with a
> compatible license.  If I recall well, I looked at the implementation
> of crypt() in glibc, but it depended on so many other things that I
> gave up.  I need nice plain and portable C ...

With a little bit of cleanup (there are unnecessary hooks for
SHA1 and MD5 hashes as well) you might be able to use the NetBSD
implementation (or equally one from the other BSDs).

http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libcrypt/crypt.c
http://www.daemon-systems.org/man/crypt.3.html

Cheers,
-w

Jan Wielemaker

unread,
Feb 6, 2010, 11:53:10 AM2/6/10
to

Thanks. That was not too hard. Of course the price is that
I have to stick one of these nasty long headers in the package
documentation and all users of products that use it must do
the same :-(

Anyway, you find it in the latest GIT of the development version.
Not sure when the next binary release will be. Generally it is
never too far away :-)

Cheers --- Jan

0 new messages