From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Noob dumb question (extending emacs) Date: Sat, 23 Oct 2021 17:16:23 +0700 Message-ID: References: <86k0i6uoxd.fsf@duenenhof-wilhelm.de> <871r4ernmt.fsf@zoho.eu> <87o87hnrpt.fsf@zoho.eu> <87y26kkuag.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5564"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 23 12:17:29 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1meE5h-0001GW-5I for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 12:17:29 +0200 Original-Received: from localhost ([::1]:44400 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1meE5f-0004eU-A0 for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 23 Oct 2021 06:17:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35734) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1meE4t-0004bZ-VP for help-gnu-emacs@gnu.org; Sat, 23 Oct 2021 06:16:40 -0400 Original-Received: from mail-vk1-xa30.google.com ([2607:f8b0:4864:20::a30]:38834) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1meE4q-0002kH-Bc for help-gnu-emacs@gnu.org; Sat, 23 Oct 2021 06:16:39 -0400 Original-Received: by mail-vk1-xa30.google.com with SMTP id s136so1275809vks.5 for ; Sat, 23 Oct 2021 03:16:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=TbtvnV+ID1Jt0OhgVHQ7KxJIU1dniKAU+uX1m7A+nZA=; b=P3V293rodanhROoqi5lDQHZX8XJYNR33iEzH4EZOBIigtAZNXZfAtZtAssYg5IsKaE X5mXbjnBRcNkVJmSb1+vfRkeouCf6nh2VDF21nIyf6N2J0B+8ZoZjYEBZVYTlLX9e6/q 1UX5BQOD5nsyec6cxWoxGZ40V42l2NMWaYWH0tL2MMgr9ZQRr7D6OarZI2zeFw8PVCQp 56gk7nlRpWDAICFu196HMmvkuGwyfmWRoSQjO3IYomF/4uySDtRfmGAkaUQLnkWFWS9U 6r+w5h5rYNFkicxk8TCVxvjlsARlBaq6rYbMEVeEmvAtGjeHL47dCMnJrb017uUhMBaS 1xRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=TbtvnV+ID1Jt0OhgVHQ7KxJIU1dniKAU+uX1m7A+nZA=; b=EF2wAq2ENhjG3Vb4fYtHNwz6msI3dR2Pd6y8YtC6fcQ6ruhvjUCXSRUv93L72AmmhT xHYes1G0KkvCwxgGyYioqFKP1AbCzcQ+REDmCX5yCPjJrHQxVkF/hAUimhf0OZJiR19r d+ymrHFmpyN9LH4WYMNc72UUrWG4yCsxmGhH0zTgU9OeeoJE65BTa9ry8ux4LdiAPKTg whSCFlzYKl861AbTgNBo9XFaR3pjDkhsHR9YhprWdnROE8VYVXpWOpxw/ZuusTAS7m+j FEJoP4KzCNRJMZkP8H8ECfjg7mvCG/GYJmpNUaBdZ3XlzwKCiGyAisyf1Ks5dDmMwUnv hcZg== X-Gm-Message-State: AOAM532pcoAAyuli5K6Ru+cm1MVTB+Mg4Hyd0Qpm/4pbGGi+tbxp4Szg OyC6KuYXm5rjOE9XMHx248uc0zGbef3iSsZjaqc= X-Google-Smtp-Source: ABdhPJyDhRfrGtXc8Da1rrnC0nHbviQg7Uq6gDomeIMwewf4qBFlM8aL78zC6dwCZ2PxMrpRZ9qo1o8LXpPWZ9eof0w= X-Received: by 2002:a05:6122:208c:: with SMTP id i12mr5283133vkd.22.1634984195244; Sat, 23 Oct 2021 03:16:35 -0700 (PDT) In-Reply-To: <87y26kkuag.fsf@web.de> Received-SPF: pass client-ip=2607:f8b0:4864:20::a30; envelope-from=yurivkhan@gmail.com; helo=mail-vk1-xa30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:134044 Archived-At: On Sat, 23 Oct 2021 at 15:41, Michael Heerdegen wrote: > > Spoiler: secure password generation is not one of those purposes. > > If you use Emacs' `random' to generate a password, an attacker would > need to have access to your system to predict the result. He would at > least have to know exactly when you started your Emacs session (that > time is used to generate the seed). Or he would need much more > pseudo-random numbers from you. > > Without any of these, no chance to guess, because there are too many > possible pseudo-random numbers when you don't know at which position in > the sequence the generator started. The position in the sequence, aka the random seed, contains a certain number of bits. In Emacs, as far as I can tell, best case, the random seed is 48 bits. Which means, no matter how long a password you (the user) generate, it still contains only 48 bits of entropy. Whereas with =E2=80=98pwgen=E2=80=99 you get more entropy as you generate a longer = password. An attacker might have access to one or more passwords you generate before and/or after the password the attacker is interested in, e.g. by being one of the entities you have an account with, or by possessing a leaked database of user information from a compromised service. (It is also customary, when discussing security, to assume the attacker knows exactly the algorithms you use.) It is okay to generate your own passwords using a weak generator if you are aware of that and deem the risk insignificant. It is okay to offer a library for password generation using a weak generator to other people, as long as they are aware and deem the risk insignificant. It is *not* okay to offer a library for password generation using a weak generator to other people without explaining its entropy characteristics so that they could assess their risk.