/[soft]/gpg/random-passphrase
ViewVC logotype

Annotation of /gpg/random-passphrase

Parent Directory Parent Directory | Revision Log Revision Log


Revision 389 - (hide annotations) (download)
Thu Feb 3 11:36:18 2011 UTC (13 years, 2 months ago) by boklm
File size: 300 byte(s)
- print passphrase in hex (as ssss doesn't like binary files)
- limit to 100 bytes (as ssss only accepts 128)


1 boklm 383 #!/usr/bin/perl -w
2     use strict;
3    
4 boklm 389 my $size = 100;
5 boklm 383
6     binmode(STDOUT, ":utf8");
7    
8     open(my $rf, '<', '/dev/random');
9     while ($size) {
10     my $o;
11     print STDERR "$size random bytes to read.\n";
12     read $rf, $o, 1;
13     if ($o ne "\n" && $o ne "\r") {
14 boklm 389 print unpack("H*", $o);
15 boklm 383 $size--;
16     }
17     }
18     close($rf);
19    

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.30