[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Noob dumb question (extending emacs)
From: |
Jean Louis |
Subject: |
Re: Noob dumb question (extending emacs) |
Date: |
Mon, 25 Oct 2021 22:22:21 +0300 |
User-agent: |
Mutt/2.0.7+183 (3d24855) (2021-05-28) |
Yuri and Michael H., you are very right, too simple password
generation without enough entropy produces duplicate passwords.
The way to go is to create some entropy. Reading /dev/urandom is not a
portable solution. At this moment I would not know if it works on
DragonflyBSD which I use on some computers, I will check later.
But that does not mean that anybody may guess the password produced on
this computer.
If somebody knows how to read slice of a file like /dev/urandom, let
me know, otherwise I have to use external command.
(defun rcd-read-urandom (&optional length)
"I am also free to modify the Emacs Lisp unlimited times."
(shell-command-to-string "head -n 1 /dev/urandom"))
(defun rcd-password-generate-1 (string)
"Return capitalized or downcased single symbol from a string"
(random (format "%s" (rcd-read-urandom)))
(let* ((max (length string))
(rnd (random max))
(single (substring string rnd (+ rnd 1))))
single))
(rcd-password) ⇒ "5l}tAl9hvk^ofQkqbSWh" --- I am now more random...
--
Jean
Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns
In support of Richard M. Stallman
https://stallmansupport.org/
- Re: Noob dumb question (extending emacs), (continued)
- Re: Noob dumb question (extending emacs), Jean Louis, 2021/10/22
- Re: Noob dumb question (extending emacs), Emanuel Berg, 2021/10/23
- Re: Noob dumb question (extending emacs), Jean Louis, 2021/10/24
- Re: Noob dumb question (extending emacs), Emanuel Berg, 2021/10/24
- Re: Noob dumb question (extending emacs), Jean Louis, 2021/10/24
- Re: Noob dumb question (extending emacs), Emanuel Berg, 2021/10/24
- Re: Noob dumb question (extending emacs), Jean Louis, 2021/10/25
- Re: Noob dumb question (extending emacs), Yuri Khan, 2021/10/25
- Re: Noob dumb question (extending emacs), Emanuel Berg, 2021/10/25
- Re: Noob dumb question (extending emacs), Jean Louis, 2021/10/25
- Re: Noob dumb question (extending emacs),
Jean Louis <=
- Re: Noob dumb question (extending emacs), Emanuel Berg, 2021/10/25
- Re: Noob dumb question (extending emacs), Emanuel Berg, 2021/10/25
- About randomity, entropy, random passwords - was Re: Noob dumb question (extending emacs), Jean Louis, 2021/10/25
- Re: About randomity, entropy, random passwords - was Re: Noob dumb question (extending emacs), Emanuel Berg, 2021/10/25
- Re: Noob dumb question (extending emacs), Jean Louis, 2021/10/25
- Re: Noob dumb question (extending emacs), Yuri Khan, 2021/10/25
- Re: Noob dumb question (extending emacs), Emanuel Berg, 2021/10/25
- Re: Noob dumb question (extending emacs), Jean Louis, 2021/10/25
- About randomity, entropy, random passwords - was Re: Noob dumb question (extending emacs), Jean Louis, 2021/10/25
- Re: Noob dumb question (extending emacs), Emanuel Berg, 2021/10/28