المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : How to check if a file is encrypted



C# Programming
04-08-2009, 06:50 PM
Hello all,

I have written a simple application that allows me to encrypt / decrypt files using AES256 encryption. This part works. http://www.barakasoft.com/script/Forums/Images/smiley_smile.gif However, when using wildcards for decryption such as *.doc if you attempt to decrypt a file that was not previously encrypted a Crypto exception is thrown regarding invalid data length.

Is there a way to detect if a file is encrypted or not? I have searched and all I can find is the option of setting the encrypted attribute but this requires using the windows api and I wanted to avoid this.

Thanks for your help.

Russell