[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    OT: Password generator (Re: [PATCH] Some minor .cvsignore patches)
From:       Malte.Starostik () t-online ! de (Malte Starostik)
Date:       2001-06-04 17:39:47
[Download RAW message or body]

On Montag, 4. Juni 2001 12:30, David Faure wrote:
> On Monday 04 June 2001 04:27, Rob Napier wrote:
> > On Mon, Jun 04, 2001 at 01:20:20AM +0200, Carsten Pfeiffer wrote:
> > > On Sonntag, 3. Juni 2001 23:18 Rob Napier wrote:
> > >
> > > Do you have a CVS account? Feel free to commit those, no need to send a
> > > mail about that.
> >
> > Nope, no CVS account. That's why I always mail my patches. I'm not
> > really a developer, just the "make it go on Solaris guy" :)
>
> That's enough to get an account if you want one :)
>
> (Mail me an encrypted password, out of /etc/passwd or /etc/shadow for a
> dummy user)
The attached script makes creation of encrypted passwords quite easy. It uses 
/dev/random so the "salt" should be quite safe...just use a Strong Password 
(tm). Requires Term::ReadPassword, which is easily installed via perl -MCPAN 
-e 'install Term::ReadPassword'
-- 
Wars don't determine who's right, only who's left.
["crypt" (application/x-perl)]

#!/usr/bin/perl

use strict;
use Term::ReadPassword;

my $pass = read_password("Password: ");
unless (read_password("Confirm: ") eq $pass)
{
	print "Sorry, they don't match\n";
	exit 1;
}
open RND, "/dev/random";
read RND, my $r1, 1;
read RND, my $r2, 1;
close RND;
my $salt = join '', ('.', '/', 0..9, 'A'..'Z', 'a'..'z')
	[unpack('C', $r1) % 64, unpack('C', $r2) % 64];
print crypt($pass, $salt) . "\n";

>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic