in reply to Determine if a file is password protected
Beware that this approach has serious caveats: if your data can be real/pseudo random or compressed data, then it will also look like than a pile of random bits, so for example you won't be able to distinguish between a simple and an encrypted rar/zip file. (And don't forget that simple looking document formats can use compression internally.)
For the concrete implementation search for the chi square test on CPAN (I haven't looked but I'm almost sure you'll find some implementation) and try to experiment with it whether it can be good enough for your purpose.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Determine if a file is password protected
by Porculus (Hermit) on Feb 22, 2010 at 00:13 UTC | |
|
Re^2: Determine if a file is password protected
by mpeg4codec (Pilgrim) on Feb 21, 2010 at 21:06 UTC |