--- Ray Murphy <[EMAIL PROTECTED]> wrote: > Hello, > > Want to make sure I'm not missing anything here. My > task is to see if a file looks like it's encrypted. > I'm splitting the path/filename/extension via > File::Basename and checking to see if the extension is > ..pgp or .gpg. I'm also checking to see if the file is > a text file via 'if (-T $file)'. Is there any other > (better) way of testing to see if a file is encrypted? > I don't want to call the decryption routines if the > file is not encrypted. > > Cheers > > Ray.
Ray, This probably is not the most helpful comment, but one way to tell if something is encrypted is to compress the data using Archive::Zip or something similar. I don't know, offhand, what the threshhold is, but if a file significantly compresses then either it is unencrypted or has a lousy encryption algorithm. This is because encrypted data should look more or less random and not present patterns which allow compression. Cheers, Curtis "Ovid" Poe ===== Senior Programmer Onsite! Technology (http://www.onsitetech.com/) "Ovid" on http://www.perlmonks.org/ __________________________________________________ Do You Yahoo!? Send your FREE holiday greetings online! http://greetings.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]