Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Symbol characters for passwords

by thrig (Beadle)
on Dec 21, 2002 at 20:04 UTC ( [id://221663]=CUFP: print w/replies, xml ) Need Help??

Various means of getting symbol characters (non-alphanumerics such as !) into an array for random password generation.
# the manual way, hunting over the keyboard, and worrying about # possibly escaping certain specials (truncated example) @s = qw(! @ # $ % ^ & *); # investigation of the ASCII table shows the special characters are # in chunks, which we can convert into the real characters using map @s = map { chr } 33..47,58..64,91..96,123..126; # this can also be done without knowing where the special characters # are with a grep for printable non-alphanumeric non-whitespace chars @s = grep { /[[:print:]]/ and /[^a-zA-Z0-9\s]/ } map { chr } 1..128;

Replies are listed 'Best First'.
Re: Symbol characters for passwords
by dakkar (Hermit) on Dec 23, 2002 at 10:14 UTC

    To generate new root passwords, we did:

    #!/usr/bin/perl -w use MIME::Base64; open RND,'<','/dev/urandom'; sysread RND,$rnd,1024; close RND; print encode_base64($rnd);

    And then we hunted into the result for something we would be able to remember.

    Note: this supposes you are on a system that has /dev/urandom. Substitute it with any reasonable random-stream generator.

    -- 
            dakkar - Mobilis in mobile
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://221663]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-18 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found