From owner-freebsd-questions Sat Jan 25 11:27:18 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9723737B405 for ; Sat, 25 Jan 2003 11:27:16 -0800 (PST) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8CE3E43F6B for ; Sat, 25 Jan 2003 11:27:14 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) by smtp.infracaninophile.co.uk (8.12.6/8.12.6) with ESMTP id h0PJRAHZ045048 for ; Sat, 25 Jan 2003 19:27:10 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost) by happy-idiot-talk.infracaninophile.co.uk (8.12.6/8.12.6/Submit) id h0PJR5qm045047 for FreeBSD-questions@FreeBSD.ORG; Sat, 25 Jan 2003 19:27:05 GMT Date: Sat, 25 Jan 2003 19:27:05 +0000 From: Matthew Seaman To: FreeBSD-questions@FreeBSD.ORG Subject: Re: Misc Questions. Message-ID: <20030125192705.GC44054@happy-idiot-talk.infracaninophi> Mail-Followup-To: Matthew Seaman , FreeBSD-questions@FreeBSD.ORG References: <3E32DDB6.7040308@potentialtech.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <3E32DDB6.7040308@potentialtech.com> User-Agent: Mutt/1.5.3i X-Spam-Status: No, hits=-3.0 required=5.0 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_00_01, USER_AGENT,USER_AGENT_MUTT version=2.43 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Jan 25, 2003 at 01:55:50PM -0500, Bill Moran wrote: > >2. What command can i use if I want to crypt a word and I see it=20 > >encrypoted just like the /etc/master.passwd file? For example, I want to= =20 > >know how the password "foobar" would be encrypted in /etc/master.passwd= =20 > >if It would be my real passwd. >=20 > I don't know the answer to this one, check the source. crypt(3) is the C language interface. Or perl will let you get at it =66rom the command line. The format of the salt determines the encryption algorithm used: Eg. DES just uses two characters: % perl -e 'print crypt("password", "xx"), "\n";' xxj31ZMTZzkVA whereas MD5 uses the 'Modular' format and an 8 character salt: % perl -e 'print crypt(q{password}, q{$1$xxxxxxxx$}), "\n";' $1$xxxxxxxx$UYCIxa628.9qXjpQCjM4a. Only MD5 and DES are available in FreeBSD 4.x --- other systems may support Blowfish using salts that start $2$ Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message