From owner-freebsd-questions Mon Sep 20 22:22:51 1999 Delivered-To: freebsd-questions@freebsd.org Received: from brutus.converging.net (edtn002029.hs.telusplanet.net [161.184.135.251]) by hub.freebsd.org (Postfix) with ESMTP id C5E4F14A05 for ; Mon, 20 Sep 1999 22:22:46 -0700 (PDT) (envelope-from dtougas@brutus.converging.net) Received: (from dtougas@localhost) by brutus.converging.net (8.9.3/8.9.3) id XAA13872; Mon, 20 Sep 1999 23:40:55 -0600 (MDT) (envelope-from dtougas) Date: Mon, 20 Sep 1999 23:40:54 -0600 From: Damien Tougas To: Dan Busarow Cc: freebsd-questions@freebsd.org Subject: Re: How does this password encryption stuff work? Message-ID: <19990920234054.A13838@converging.net> References: <19990920162535.A96199@converging.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Are you saying that if the password was 'secure' that the key would be 'se'? I have tried that but have not had any luck as of yet. It seems that only passwords encrypted in master.passwd will work. I have tried using both crypt and bdes, both did not seem to work. One thing that I did notice wat that crypt and bdes used weird shapes and other strage characters, where as all encrypted passwords in master.passwd are just basic ascii characters. I must be missing somthing here, but I'm not sure what. Any suggestions are very much appreciated. My application is this: ProFTPd allows you to set a different password for a user using the UserPassword directive in the config file. The problem is that the new password in the config file must be encrypted (as is said in the documentation using the crypt() command). I do not know how to effectively encrypt a plain text password so that it works. The only way I have been able to do it is by pulling the already incrypted password from master.passwd. -- Damien Tougas Converging Technology Solutions, Inc. Phone: (780)469-1679 Fax: (780)461-5127 E-mail: dtougas@converging.net http://www.converging.net > > I am trying to understand how password encryption works using a tool > > such as the crypt command. I recently had to put an encrypted password > > in a config file for a program, and was not sure how exactly to do it. > > What I ended up doing was temorarily creating a user with the password > > that I wanted, then copied the encrypted password from master.passwd > > into the config file, then deleted the user. I know ther is a simpler > > way to do this, but I do not understand how it works. If I use the > > crypt program, I am required to put in a key. That means that the > > encrypted password could be anything, which I suppose is good, but > > how does the program then compare the password the user enters it with > > the actual encrypted password, if it does non know what the key is? > > The "key" is the first two characters of the plain text password. > > Dan > -- > Dan Busarow 949 443 4172 > Dana Point Communications, Inc. dan@dpcsys.com > Dana Point, California 83 09 EF 59 E0 11 89 B4 8D 09 DB FD E1 DD 0C 82 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message