TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Tired of memorizing passwords? Manuel Blum came up with this algorithmic trick

56 点作者 jalcazar超过 9 年前

24 条评论

todd8超过 9 年前
On Sept 30, 2014 I sent two emails to Dr. Blum explaining what I believed was the weakness with the approach he was advocating. He never responded (or somehow I never saw a response).<p>Here is a snip from the first email:<p>Begin ---%&lt;------------%&lt;---------------------------------<p>As I understand it, the algorithm, expressed in Python is:<p><pre><code> ######################### import sys from string import ascii_uppercase as alphabet # ABCDEFGHIJKLMNOPQRSTUVWXYZ LETTER = &quot;31415926535897932384626433&quot; NUMBER = [0,2,4,6,8,1,3,5,7,9] def f(ch): assert ch in (alphabet + &quot;0123456789&quot;) if ch in alphabet: return int(LETTER[alphabet.index(ch)]) if ch in &quot;0123456789&quot;: return int(ch) def g(n): return NUMBER[(NUMBER.index(n) + 1) % 10] def pw(s): digit = g((f(s[0]) + f(s[-1])) % 10) result = [digit] for c in s[1:]: digit = g((digit + f(c)) % 10) result.append(digit) return result print(sys.argv[1], pw(sys.argv[1])) ######################### </code></pre> Consider a few results from encryption and what it presents to the adversary:<p><pre><code> pw(“ABC”) == 928 pw(“ABCABC”) == 928362 </code></pre> If “ABC” is a seed to the algorithm, then any seed that shares a prefix and a final character will have information leaked, sometimes enough to reveal the entire generated password for a different seed.<p>It’s actually worse than this. For example, if the adversary knows that:<p><pre><code> pw(“AAT”) == 941 pw(“ABC”) == 928 pw(“BBC”) == 717 </code></pre> then the adversary knows that the mapping from the character C to an integer is the same as the mapping from character T. Using the terminology presented in the lecture this is<p><pre><code> f(“C”) == f(“T”) </code></pre> and from this adversary can determine information about the result of the password algorithm on other seeds.<p><pre><code> pw(“BBT”) == 717 pw(“B.*T”) == 7.* </code></pre> Because the algorithm uses a recurrence that generates one ciphertext character from the result of preceding ciphertext character, the adversary can make further inferences:<p><pre><code> pw(“BAT”) == 728 </code></pre> which implies that if the preceding ciphertext is 7 and the current seed character is A that the resulting ciphertext will be 2. Consider<p><pre><code> pw(“BAT”) == 728 pw(“XAB”) == 725 pw(“XAAB”) == 7271 pw(“XAAAB”) == 72725 </code></pre> End ---%&lt;------------%&lt;---------------------------------<p>My second email on Sept 30, 2014 contained the solution to a challenge he proposed in the video of a lecture on the method he gave:<p>Begin ---%&lt;------------%&lt;---------------------------------<p>On one slide during your recent lecture, you present a bit of a challenge, and I noticed that by making use of just the four plaintext&#x2F;ciphertext pairs:<p><pre><code> BRAIN -&gt; 06076 TRAIN -&gt; 27732 GRAIN -&gt; 35618 DRAIN -&gt; 54349 </code></pre> One can conclude that the permutation of [0,1,2,3,4,5,6,7,8,9] that controls the mapping g() must be one of the cycles:<p><pre><code> 6159073428 8106279354 &lt;- this turns out to be the one </code></pre> In fact, with a bit more work one can deduce that it is the second by making use of the additional plaintext&#x2F;ciphertext pair (which appears on the same slide):<p><pre><code> AND -&gt; 496 </code></pre> So now we know that<p><pre><code> g(0) -&gt; 6 g(1) -&gt; 0 g(2) -&gt; 7 g(3) -&gt; 5 g(4) -&gt; 8 g(5) -&gt; 0 g(6) -&gt; 2 g(7) -&gt; 9 g(8) -&gt; 1 g(9) -&gt; 3 </code></pre> With g() in hand, it is short work to build up the mapping of f(). For these five words, the letters involved are A, B, D, G, I, N, R, and T.<p><pre><code> f(A) -&gt; 5 f(B) -&gt; 8 f(D) -&gt; 0 f(G) -&gt; 6 f(I) -&gt; 2 f(N) -&gt; 3 f(R) -&gt; 0 f(T) -&gt; 0 </code></pre> Notes on decryption ===================<p>The details of this decryption aren&#x27;t very interesting, so I won’t go into detail. I didn&#x27;t need to use a computer, just paper and pencil. The important observation was that from BRAIN -&gt; 06076 one knows<p>g(0 + f(R)) -&gt; 6<p>and from TRAIN -&gt; 27732 one knows<p>g(2 + f(R)) -&gt; 7<p>thus if g(k) -&gt; 6, g(k+2) -&gt; 7.<p>This means that map(g, [0,1,2,3,4,5,6,7,8,9]) is some rotation of the list [_,_,_,_6,_,7,_,_,_,_] where 6 and 7 are at two locations apart.<p>Every letter, say &#x27;A&#x27;, which appears in more than two places in any of the plaintext&#x2F;ciphertext pairs reveals information about g(). So BRAIN -&gt; 06076 and TRAIN -&gt; 27732 also reveals that<p>g(6 + f(A)) -&gt; 0 and g(7 + f(A)) -&gt; 7<p>Therefore, if g(k) -&gt; 0 then g(k+1) -&gt; 7. Thus, we can now conclude that map(g, [0,...,9]) is some rotation of [_,_,_,_,6,0,7,_,_,_].<p>In this fashion I concluded that map(g,[0,...,9]) was some rotation of [2,9,1,3,6,0,7,5,8,4]. I knew that g()&#x27;s corresponding permutation was a circular permutation with a single cycle because that was a part of the system that makes it easier to memorize.<p>In general, of course, there could be ten possible mappings, one for each rotation. However, in practice some of these rotations won&#x27;t produce a permutation with a single cycle. This isn&#x27;t really a problem because ten possible mappings for g() are still easy to validate in the next phase where we derive the mapping f(). In this particular case, there were only two possible circular permutations making it easy to decrypt the system with just paper and pencil.<p>The next step is to try out each of the possible g()&#x27;s determined above on the plaintext&#x2F;ciphertext pairs. For example, BRAIN -&gt; 06076 implies that<p>g(0 + f(R)) = 6<p>applying the inverse map of g() to both sides<p>0 + f(R) = 0<p>so<p>f(R) -&gt; 0<p>In this manner the entire decryption can be performed.<p>End ---%&lt;------------%&lt;---------------------------------
jeremysmyth超过 9 年前
This method fails as soon as you have to change a password:<p>- One of the sites is compromised<p>- One of your devices is stolen&#x2F;lost and you have to change some passwords<p>- One of the sites has a password expiration policy<p>Pretty soon you end up with multiple password schemes and you&#x27;re in precisely the same situation as before, wondering which password goes with which site, only this time you have to perform algorithmic dances in addition to memory feats.
评论 #10197325 未加载
评论 #10201674 未加载
评论 #10197112 未加载
评论 #10196994 未加载
评论 #10198692 未加载
评论 #10197087 未加载
surlyadopter超过 9 年前
Articles like these always remind me of this fantastic essay by James Mickens and his &quot;Mossad&#x2F;Not Mossad&quot; concept.<p><a href="http:&#x2F;&#x2F;files.catwell.info&#x2F;misc&#x2F;mirror&#x2F;mickens-usenix&#x2F;thisworldofours.pdf" rel="nofollow">http:&#x2F;&#x2F;files.catwell.info&#x2F;misc&#x2F;mirror&#x2F;mickens-usenix&#x2F;thiswor...</a><p>&quot;“But James,” you protest, “there are many best practices for choosing passwords!” Yes, I am aware of the “use a vivid image” technique, and if I lived in a sensory deprivation tank and I had never used the Internet, I could easily remember a password phrase like “Gigantic Martian Insect Party.” Unfortunately, I have used the Internet, and this means that I have seen, heard, and occasionally paid money for every thing that could ever be imagined. I have seen a video called “Gigantic Martian Insect Party,” and I have seen another video called “Gigantic Martian Insect Party 2: Don’t Tell Mom,” and I hated both videos, but this did not stop me from directing the sequel “Gigantic Martian Insect Party Into Darkness.” Thus, it is extremely difficult for me to generate a memorable image that can distinguish itself from the seething ocean of absurdities that I store as a result of consuming 31 hours of media in each 24-hour period.&quot;
drinchev超过 9 年前
I try to ignore articles like this and I&#x27;m surprised that this was written in 2015. As @jeremysmyth noted this method is flawed.<p>There&#x27;s no solution for passwords today, better than the password manager.<p>People reading this article, should not consider Manuel Blum&#x27;s idea as use-worthy.
评论 #10197070 未加载
评论 #10198506 未加载
dyates超过 9 年前
And now your password strength is a function of the length of the site&#x27;s name. Great!<p>EDIT: This seems like much more effort than just using a password manager, or even just a stronger, memorable passphrase or two.
评论 #10196910 未加载
评论 #10196940 未加载
sprash超过 9 年前
Why not use a base64 encoded sha1 hash of your password salted with the web address like this:<p><pre><code> #!&#x2F;bin&#x2F;sh #usage: webpass.sh &lt;website&gt; website=$1 stty -echo read -p &quot;Password: &quot; password echo stty echo echo -n &quot;$website&quot; | openssl sha1 -hmac &quot;$password&quot; | cut -d&quot; &quot; -f2 | xxd -r -p | base64 | tr -d -c &quot;[:alnum:]&quot; echo </code></pre> At least this is somewhat cryptographically secure.
评论 #10197220 未加载
评论 #10197393 未加载
评论 #10198749 未加载
facepalm超过 9 年前
Not sure if memorizing a 6x6 matrix and computing that password in one&#x27;s head is very efficient.<p>Also, shouldn&#x27;t there be standard encryption schemes for doing stuff in your head? That homemade matrix encryption is probably not very hard to break.
评论 #10197147 未加载
xedarius超过 9 年前
I&#x27;ve often wondered why login systems don&#x27;t simply rely on the same system they use for password recovery. Instead of logging in with a username and password, why not request a login token that is emailed to me. I then use that link to access the site and never really have to think about passwords.
评论 #10197174 未加载
评论 #10197976 未加载
meerita超过 9 年前
1Password &lt;3<p>It replaced all my alternatives and I don&#x27;t have to think anymore about passwords. It saved me a lot overseas and doing a new fresh install in my computers is not painful anymore.
评论 #10197206 未加载
sheldor超过 9 年前
[Off-topic - meta rant]<p>Article with bad advice (not controversial - just plain bad), agreed by every single person in this conversation; yet in the front page of hacker news.<p>Beats me every time.<p>[&#x2F; Off-topic - Meta rant]
gedsic超过 9 年前
A six-character password for Amazon? What&#x27;s next? A four-character password for eBay?
spikej超过 9 年前
... and what happens when one of the sites asks you to change the password every 90 days? sit there and re-do all?
keerthiko超过 9 年前
It&#x27;s much better to use reasonable_passphrase + &quot;-&quot; (or other special character permitted in most passwords like &#x27;.&#x27; or &#x27; &#x27; or &#x27;,&#x27;) + site_name.<p>So &quot;Superdonkey11_amazon&quot; and &quot;Superdonkey11_dropbox&quot; would be strong passwords, where compromising one to a password database leak would only jeopardize other passwords if a human would pick out your password and think about how it applies to other services you use.<p>If you have to change your password with the site just cycle through a couple root passphrases. You now have salted your password per site in a human-memorizable way without some weird algo ritual to access every password.
评论 #10197076 未加载
hughhopkins超过 9 年前
This is not the easiest way off having secure passwords that you don&#x27;t have to store. Yes, there are password managers but if you don&#x27;t want to store&#x2F;save your passwords anywhere you could use pwdhash which is based off MD5.<p>Friend of mine actually built one off SHA1 and it&#x27;s all open at <a href="https:&#x2F;&#x2F;github.com&#x2F;simontabor&#x2F;pw&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;simontabor&#x2F;pw&#x2F;</a> or www.pwapp.io. It&#x27;s 40 chars so much much better than pwdhash (but that&#x27;s the original I guess).
nr152522超过 9 年前
Something I have always pondered,...would it be more secure to request a password after the user has been identified by the system?<p>For example,...<p>1. User clicks login 2. Webcam uses facial recognition to identify the user. 3. The identified user is requested to enter their password.<p>In this case, I think, it is harder to impersonate the real user. I am no expert but would interested to know if anyone can see any obvious flaws or if something similar exists?
评论 #10197169 未加载
OrangeTux超过 9 年前
I use a method like for years and it works great. I also included some non alphanumeric characters so I fits in almost every password policy.
nicosandller超过 9 年前
Hey guys, I created a simple app to decode your password using this algorithmic trick.<p>Check it out and tell me what you think!<p><a href="https:&#x2F;&#x2F;nicosandller.firebaseapp.com&#x2F;projects&#x2F;passwordshelper" rel="nofollow">https:&#x2F;&#x2F;nicosandller.firebaseapp.com&#x2F;projects&#x2F;passwordshelpe...</a>
amelius超过 9 年前
This is cryptographically insecure.<p>I think the industry should come up with a better solution for managing passwords.
评论 #10198807 未加载
meesterdude超过 9 年前
I do something similar, where i build passwords out of words or ideas and if i forget it I have a way of going back to it, albeit with some work. I don&#x27;t suggest tying it to the website name because changing your password becomes difficult.
rdancer超过 9 年前
Guvf, vaqrrq, vf gur zbfg frpher fpurzr xabja gb znaxvaq!
评论 #10197108 未加载
评论 #10198817 未加载
ColinWright超过 9 年前
Also mentioned here:<p><a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10153795" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=10153795</a>
yellowapple超过 9 年前
Gah. The title might as well be reworded as &quot;Manuel Blum came up with this one weird algorithmic trick; password managers hate him!&quot;.
nerdy超过 9 年前
Caesar Cipher 2015!
cdnsteve超过 9 年前
OAuth or bust