Re: Hash question ...



On 3 Mar 2007 15:40:37 -0800, "Matthew Fanto" <mfanto@xxxxxxxxx>
wrote:

What you can do is just encrypt a known header and if it decrypts, the
key is correct. That is, every encrypted file has the same beginning
header, encrypted under the key of that file.

Wouldn't that provide a shortcut for a brute force attack? I assume
you mean having a constant byte sequence encrypted with the same key
as the data?

But the bigger question is, you said you store a hash of the plaintext
to validate the key, but you worry about how long it takes to verify
the plaintext. To me that sounds like you aren't doing integrity
checking on the encrypted data. Are you MACing the encrypted data?

I do currently store the hash of the plaintext, in the interest of
checking data integrity. If the ciphertext is corrupt, then the hash
of the plaintext surely wouldn't match the stored value, would it?

Let me elaborate a bit :

Init hash function
Init decrypt function
Do
Retrieve a block (64KB) of ciphertext
Decrypt the block
Add the block of plaintext to the running hash
Write the plaintext to another file
Loop
Compare hash in header to 'running' hash

I'm using a symmetric algorithm, so I'm not sure MAC would apply,
unless I've missed something, which is likely.

-Matt

J.
Jeremiah D. Seitz
Omega Techware
http://www.omegatechware.net
.



Relevant Pages

  • Re: Reducing the chance of collisions in known encryption systems
    ... > Isn't it that in your scheme one hash gives one ... collision string = a plaintext string of characters that would result ... The idea is to use a predefined ruleset (such as the ascii values of ...
    (sci.crypt)
  • Re: Does OTP need authentication?
    ... > I am assuming that the original sender would calculate the hash of the ... > plaintext, append that hash to the plaintext, and encrypt the lot with ... > the OTP. ... I'm never sure about Mallory.) ...
    (sci.crypt)
  • Re: AES Analysis available?
    ... the plaintext as the IV for CBC mode encryption with an appropriate ... padding scheme. ... Using a hash makes me slightly nervous. ... plaintext such that it has a particular relationship with the IV that'll ...
    (sci.crypt)
  • Re: Combined Signature and Encryption Schemes.
    ... A block cipher on the Plaintext, this gives me the CipherText ... A Mac on the Ciphertext ... digitally signing the MAC value would remove the need for a hash pass ...
    (sci.crypt)
  • RE: On passwords, securtiy and real -sweat, blook and tears- life
    ... it's rarely sent as plaintext anymore. ... In some cases the password is "hashed" locally and the hash, ... I.e.,, take all permutations of allowed password characters and then ... Unfortunately most passwords are dictionary words, ...
    (Fedora)

Quantcast