[Top][All Lists]

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

Re: Noob dumb question (extending emacs)

From: Emanuel Berg
Subject: Re: Noob dumb question (extending emacs)
Date: Mon, 01 Nov 2021 03:09:54 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Michael Heerdegen wrote:

>> See below, if we remain at 48 bits of entropy, but instead
>> of 60 have an alphabet of only 3 chars, the password length
>> rises from 8.13 chars to 30.28 ...
>> Does this tell us that it is equally difficult to randomly
>> guess the both passwords from the two different
>> configuration at these lengths, or what does it tell us?
> If your calculation is correct, then yes, sure (if it's
> clear to the attacker what exact alphabet you used).
> As I said, it's just counting.

What do you mean by that, do you mean it doesn't say anything,
it is just the relationship between these three things?

If so, that's good enough for me, but then what does "password
length" mean? If "sex", "love" and "god" are passwords of
length 3, 4 and 3 respectively, I understand that, but what
password length are we talking about when we are
just counting?

;;; -*- lexical-binding: t -*-
;;; this file:
;;; 48 bits, alphabet length n, password length l
;;; 2^48     = n^l            <=>
;;; 48*ln(2) = l*ln(n)        <=>
;;; l        = 48*ln(2)/ln(n)

(defun epwgen-password-length (bits abc)
  (let ((abc-len (if (numberp abc)
                   (when (listp abc)
                     (length abc) ))))
    (when abc-len
      (/ (* bits (log 2)) (log abc-len)) )))

;; (epwgen-password-length 48 60)       ;  8.13
;; (epwgen-password-length 48 '(a b c)) ; 30.28

(defun urandom (bits)
  (interactive "nbits: ")
  (let*((bytes     (/ bits 8))
        (bytes-opt (format "--bytes=%s" bytes)) )
      (set-buffer-multibyte nil)
      (call-process "head" "/dev/urandom" t nil bytes-opt)
       (buffer-substring-no-properties (point-min) (point-max)) ))))
;; (urandom 100)

(provide 'epwgen)

underground experts united

reply via email to

[Prev in Thread] Current Thread [Next in Thread]