From owner-freebsd-questions Thu Apr 10 05:20:53 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id FAA02303 for questions-outgoing; Thu, 10 Apr 1997 05:20:53 -0700 (PDT) Received: from dg-rtp.dg.com (dg-rtp.rtp.dg.com [128.222.1.2]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id FAA02295 for ; Thu, 10 Apr 1997 05:20:37 -0700 (PDT) Received: by dg-rtp.dg.com (5.4R3.10/dg-rtp-v02) id AA01336; Thu, 10 Apr 1997 08:20:06 -0400 Received: from ponds by dg-rtp.dg.com.rtp.dg.com; Thu, 10 Apr 1997 08:20 EDT Received: from lakes.water.net (lakes [10.0.0.3]) by ponds.water.net (8.8.3/8.7.3) with ESMTP id HAA18385; Thu, 10 Apr 1997 07:53:20 -0400 (EDT) Received: (from rivers@localhost) by lakes.water.net (8.8.3/8.6.9) id HAA12773; Thu, 10 Apr 1997 07:59:36 -0400 (EDT) Date: Thu, 10 Apr 1997 07:59:36 -0400 (EDT) From: Thomas David Rivers Message-Id: <199704101159.HAA12773@lakes.water.net> To: ponds!FREEBSD.ORG!freebsd-questions, ponds!cisco.com!raj Subject: Re: How is passwd crypt'ed? Content-Type: text Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > I have a program which locks your X screen and asks for your password > in order to unlock it. (Yes, I know about cntrl-alt-backspace to exit > X, and I know the program has to be setuid root in order to access the > shadowed passwords.) I need to know how I should call "crypt" in > order to encrypt what the user typed so I can compare the encrypted > password strings. In previous versions BSD the seed was the taken as > the first 2 characters of the encrypted password entry so you could > simply pass the encrypted password to crypt as the second argument. I > tried that under FreeBSD and it doesn't seem to work. > > Can someone quickly tell me how passwords are encrypted under FreeBSD? > If no one knows right off I can do the research looking at source for > passwd.c but I figured someone may know right off. > > Thanks. > > /raj > Well I certainy don't want to dampen your spirits - can I ask, what's wrong with xlockmore in the packages? It works great for me... As far as crypt() itself the man page on it is quite helpful... an example of using it can be found in /usr/src/usr/bin/login/login.c. - Dave Rivers -