- Dec 6, 2000
- 261
- 0
- 0
hi all -- I have been vaguely curious about this for a little while --
when you have an encrypted file, and you go to decrypt it with whatever program, it will ask you the key, and begin decrypting if correct. But how does it know if the key is correct or not? I.e. you can decrypt a file with any password/key, and it is not like the program should know if it's right or not.
Does it look at the file contents to see if what's coming out makes sense, in some standardized header for example? But if the original file was gibberish (as a test), how could it tell?
One friend suggested that the correct password is the first thing in the file, so that the program sees that what you entered exactly matches the first thing out of it. That could work, but then isn't having a known piece of information at the very beginning of the file self-defeating of the encryption? You would be able to figure out what input key would generates the first string that is itself, right?
would be glad to know the answer from you all!
when you have an encrypted file, and you go to decrypt it with whatever program, it will ask you the key, and begin decrypting if correct. But how does it know if the key is correct or not? I.e. you can decrypt a file with any password/key, and it is not like the program should know if it's right or not.
Does it look at the file contents to see if what's coming out makes sense, in some standardized header for example? But if the original file was gibberish (as a test), how could it tell?
One friend suggested that the correct password is the first thing in the file, so that the program sees that what you entered exactly matches the first thing out of it. That could work, but then isn't having a known piece of information at the very beginning of the file self-defeating of the encryption? You would be able to figure out what input key would generates the first string that is itself, right?
would be glad to know the answer from you all!