From owner-freebsd-questions Wed Apr 9 22:31:40 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id WAA16478 for questions-outgoing; Wed, 9 Apr 1997 22:31:40 -0700 (PDT) Received: from hubbub.cisco.com (mailgate-sj-1.cisco.com [198.92.30.31]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id WAA16473 for ; Wed, 9 Apr 1997 22:31:36 -0700 (PDT) Received: from raj.cisco.com (sl-chanty-05.cisco.com [171.69.126.159]) by hubbub.cisco.com (8.8.4-Cisco.1/CISCO.GATE.1.1) with ESMTP id WAA00325 for ; Wed, 9 Apr 1997 22:30:56 -0700 (PDT) Received: from localhost.cisco.com (localhost.cisco.com [127.0.0.1]) by raj.cisco.com (8.8.5/8.8.5) with SMTP id WAA01291 for ; Wed, 9 Apr 1997 22:31:05 -0700 (PDT) Message-Id: <199704100531.WAA01291@raj.cisco.com> To: freebsd-questions@freebsd.org Subject: How is passwd crypt'ed? Date: Wed, 09 Apr 1997 22:30:45 -0700 From: Richard Johnson 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