News for hackers. Stuff that matters.
Re:Hashing is not encryption by triska on Sunday January 09, 2022 @06:27AM (#29862344)
No, because the key stream is not random: It depends functionally on the integer which is sent in plain text, and on the shared secret.

For example, if you pick the same integer twice with the same secret then the XOR of the two ciphertexts is the XOR of the two plaintexts, thus losing confidentiality.

Re:Hashing is not encryption by Karliss on Sunday January 09, 2022 @06:46AM (#29862441)
Neither is OTP secure if you reuse the key. One of main properties of OTP is that an encrypted message could be decrypted to any message of same size. In case of block cyphers and message longer than one block only a fraction of all messages can be obtained. So if you had enough compute resource(and it wasn't more than atoms in universe) for brute force or weakness was found in cyphers you could find which of the potential decrypted messages makes sense and is more likely.
Re:Hashing is not encryption by smitty1e on Sunday January 09, 2022 @07:24AM (#29862646)
> Neither is OTP secure if you reuse the key.

I thought the OT meant "One Time". Reusing the key would take the key from singular to plural usage, no?

Re:Hashing is not encryption by Karliss on Sunday January 09, 2022 @09:27AM (#29863494)
Yes, but I was explaining that no reuse requirement can be equally important for encryption schemes that don't have it included in the name. Claiming that one of them is worse than other because of number reuse even though doing so is equally wrong for both is not a good example.
Re:Hashing is not encryption by pdpi on Sunday January 09, 2022 @09:01AM (#29863268)
Yup, but it’s more useful to talk about that reuse as a bad implementation of one-time pads than it is to call it something other than OTP.

In the classic sense of a small paper pad used by spies, reuse was fairly common because of the logistical problem of supplying agents with fresh pads.

Re:Hashing is not encryption by Closi on Sunday January 09, 2022 @08:08AM (#29862878)
Absolutely - OTP with key reuse is not OTP!
Re:Hashing is not encryption by runeks on Sunday January 09, 2022 @07:02AM (#29862535)
Would it be secure to encrypt a sequence of blocks by having the next integer be H(k) — such that the random integer for block number i is H applied to the original random integer (k) i times? Thus needing only an initial random integer from which all subsequent random integers are derived.
Re:Hashing is not encryption by eternalban on Sunday January 09, 2022 @07:28AM (#29862677)
The general idea is to create a PRNG using the cryptographic hash. Since these hashes generally produce far more bits than needed for scalars (64 bits), you can mix the extra bits for the next cycle of the PRNG and emit (say) 64 bits per cycle. The sequence of the PRNG output is the 'pad'.