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.
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.)