jj57
Reputation
Next privilege 50 Rep.
Comment everywhere
 Dec 3 awarded Popular Question Jun 10 awarded Student Sep 5 comment Using one-way hash functions as the encryption method One thing I would like to add is that for SHA to function as a PRF apparently you need to input twice as much entropy into it, then you get 512 bits of entropy output which is considered to have full entropy. This is mentioned in NIST Special Publication 800-90B (draft). So perhaps inputting more of the previous hash outputs into the next key to XOR with the next word will provide a better quality random key. What do you think? Sep 5 awarded Scholar Sep 5 comment Using one-way hash functions as the encryption method I've marked yours as the accepted answer because you provided some constructive criticism and actually came up with a workable solution using the HMAC. Whereas the others just criticize with an arrogant attitude and don't bother to offer up ideas for improvement. So thank you. Sep 5 accepted Using one-way hash functions as the encryption method Sep 4 awarded Editor Sep 4 revised Using one-way hash functions as the encryption method added 1895 characters in body; edited tags Sep 4 comment Using one-way hash functions as the encryption method In your modified edition, if you need two keys now, why doesn't Bob send both keys to Alice at the start? Also why not HMAC the entire encrypted message for the authentication with key #1 (ie "Encrypt then MAC") which has better security. Can key #2 be re-used for other messages safely? Sep 4 comment Using one-way hash functions as the encryption method If including just the previous 512 bits, is that really enough new entropy for the next key? The only difference is words and null padding. How did you calculate that multiple algorithms only adds minimal strength? There would be a 1 in 7 chance of success. Best case, an attacker guesses the right algorithm and needs to perform 2^512 brute force calculations. Worst case they need to try 2^512 + 2^512 ... This is worse if you only have a 128 bit key. Then they only need to try 2^128 calculations to find the right key. On a quantum computer this would reduced to 2^64 using Grover's algorithm. Sep 3 awarded Commentator Sep 3 comment Using one-way hash functions as the encryption method Yes that was the intention originally, not reusing words. However perhaps a unique IV could be sent with each message. Then that is used in creating the hash for each word. This would involve recomputing the database for each message though. Depending on computer/server speed/capability this may be OK. With a multi CPU/multi core server this would be done in a under a minute. Ilmari Karonen [posted a modification]( crypto.stackexchange.com/a/10156/8220) which could work too. Sep 3 comment Using one-way hash functions as the encryption method Perhaps a unique IV could be sent with each message. Then that is used in creating the hash for each word. This would involve recomputing the database for each message though. Depending on computer/server speed/capability this may be OK. With a multi CPU/multi core server this would be done in a minute or less. Ilmari Karonen posted a modification below which could work too. Sep 3 comment Using one-way hash functions as the encryption method In the encryption step, are you saying that for the second word, you would HMAC the previous 128 bytes of the ciphertext which provides the key for the next word to be XORed? I would leave the original key at 512 bits or even 1024 bits though as it doesn't make any sense to weaken it. Also I wouldn't communicate which hash algorithm was being used in public. That would also weaken the scheme. But SHA-512 is fine for the example. Sep 3 comment Using one-way hash functions as the encryption method Except that each key and algorithm will produce an entirely different unknown language each time. If you had just one key and one language then over time you could map the words from one language to the next. Sep 3 comment Using one-way hash functions as the encryption method They cracked the Enigma code because they got a hold of an Enigma machine. Also their randomness produced by operators was insufficient, there were procedural flaws, operator mistakes, laziness, neglect of the need to introduce systematic changes of encoding parameters, crib-dragging and capturing of key tables and hardware. That's how Allied cryptanalysts were able to be so successful. Sep 3 comment Using one-way hash functions as the encryption method Can you explain how an attacker will coerce a user to encrypt "a chapter of a book" or other chosen plaintext? They can't communicate with the user outside the channel. If they attempt to forge/alter a message asking the other user to send a chapter from the book, then the MAC will fail. They also can't send a valid message to the other user because they don't have the key. For all an attacker knows, the users could be sending military style messages e.g. "ATTACK BEGINS MIDNIGHT" or "LEAVE BASE MIDDAY". There could be no common/frequent words to assist an attacker with frequency analysis. Sep 3 comment Using one-way hash functions as the encryption method Can you quantify how "'known plaintext' and 'chosen ciphertext attacks' also destroy the scheme with near 0 workload"? Sep 3 comment Using one-way hash functions as the encryption method Usually frequency analysis is usually done on individual letters rather than on words. If I use this page as a reference you can see the common words and their ranking. Basically it becomes a probability game for an attacker. Did they use the word the or and or of etc. Other common words are very likely to match that hash too. An attacker can't tell which word with absolute certainty. Please also explain the usefulness of decrypting the word the. You say "long term analysis" of all messages. How long is that? Why not re-exchange keys every other month? Sep 3 comment Using one-way hash functions as the encryption method Can you explain how frequency analysis is more effective than I think it is? I specifically mentioned it could be avoided by not using common words like the in messages. How does building a unique block database help them figure out which word corresponds to which hash with absolute certainty? They would have to brute force attempt it at cost of 2^512 or construct a rainbow table. I agree it is a lot slower than conventional methods, but it's short messages so it's not a huge deal. Please quantify your hyperbole that it is "millions of times less secure" than other methods.