Hot answers tagged

6

Your intuition is on the right track: if you run a pseudorandom function in counter mode with your secret key, you get a stream cipher. Some stream ciphers are designed like this, perhaps most notably Salsa20 (and its later variant ChaCha20). But the key to answering your question, as I see it, is to note that a collision-resistant hash function like SHA-2 ...


1

I was doing something like this, and discovered just how careful you need to be. I wanted to do password encryption using widely available primitives so that I could do re-keying within MySQL easily. I was already doing AES256 CTR and following the prescribed usage to the letter. fileKey = random256Bits() ivPerWrite = random256Bits() //version 1 of the ...



Only top voted, non community-wiki answers of a minimum length are eligible