[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: One-line password generator



On Fri, Sep 01, 2017 at 09:58:19AM -0500, Mario Castelán Castro wrote:
> On 22/08/17 10:04, Mario Castelán Castro wrote:
> > I have the following line in my Bash init file:
> > 
> > “alias gen-password="head -c 16 /dev/urandom | base64 | head -c 22 && echo"”
> > 
> > This generates a password with just above 128 bits of entropy. You may
> > find it useful.
> 
> A slight simplification:
> 
> alias gen-password="head -c 16 /dev/urandom | base64 | cut -c -22"
> 
> -- 
> Do not eat animals; respect them as you respect people.
> https://duckduckgo.com/?q=how+to+(become+OR+eat)+vegan

pwgen is rather convenient too: pwgen -sy 100


(Probably obvious, but as long as you're reading from urandom,
"entropy" is the wrong word, in this context, better to say "128 bits
of crytographically secure numbers" as that which has been said e.g.
by the Linux kernel urandom developers as being "crypographically
secure" has changed a few times, and may change again in the future -
it it truly were entropy (as /dev/random suggests it provides), the
ongoing changes for "security" would not be necessary.)

Good luck,


Reply to: