From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mail.saout.de (Postfix) with ESMTP for ; Thu, 5 Nov 2009 23:03:19 +0100 (CET) Date: Thu, 5 Nov 2009 23:03:25 +0100 From: Heinz Diehl Message-ID: <20091105220325.GA12208@fancy-poultry.org> References: <20091105204220.A3F847BD70@ws5-10.us4.outblaze.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20091105204220.A3F847BD70@ws5-10.us4.outblaze.com> Subject: Re: [dm-crypt] Crack a dm-LUKS partition or harddisk List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: dm-crypt@saout.de On 05.11.2009, Si St wrote: > For my wireless router I double the character count to 32. You can safely use up to 63 characters. To set up wireless AP, I use this little script I hacked together quite some time ago, it works very well. It generates passwords in the correct character range for wireless AP using /dev/random. Save this in a file, do a "chmod +x " on it, and run it with the desired length as argument. In case it is a large passphrase you want to generate, you'll have to move the mouse a bit. #!/usr/bin/perl -Tw use strict; my $randkey; my $iter; my $howmany; $howmany = $ARGV[0]; $randkey = &gen_randkey; if ($randkey) { print "Passphrase: $randkey\n"; } else { print "Something went wrong\n"; } sub gen_randkey { my $keylength = $howmany; my $len = shift; $len = $keylength unless $len; my @range; @range = (33..126); my $id = &read_dev_random($len); return unless $id; $id =~ s/(.)/chr($range[ord($1) % $#range+1])/esg; return $id; } sub read_dev_random { my $len = shift; unless ($len) { print STDERR "No parameter given\n"; return; } eval { open(RANDOM, "/dev/random") or die; }; if ($@) { print STDERR "Unable to open the random device\n"; return; } my $random; unless (read(RANDOM, $random, $len) == $len) { print STDERR "Unable to read from the random device\n"; return; } close(RANDOM); return $random; }