Is there any way using the crypt library to tell is a .tif file has already been encrypted?
asked Sep 19 '13 at 17:19
Symmetric encryption algorithms, such as AES, Blowfish, 3DES, RC2, etc. are simply mathematical computations that transform input bytes to output bytes having the characteristics of random byte data (where each byte value 00 through FF is equally possible, and the bytes are seemingly random). There is no file format. In other words, encrypting a file w/ any of these symmetric algorithms does not result in output that is structured in any way (i.e. no headers, no identifying structure, etc.) Decryption is simply the reverse mathematical computation.
To tell if a particular file is encrypted or not, you'll have to use something that is known about the file type. Most file types are such that they begin with a recognizable first few bytes. For example, for tif:
The same kind of thing can be said for many file types: Zip, PDF, etc..
answered Sep 23 '13 at 08:49