how to check if the data is already encrypted or not

advertisements

I am using RijndaelManaged in my current project to encrypt data , is there any way tht I can check whether the data is already encrypted or not so i don't end up encrypting it twice?


No, there is no reliable way to know whether the data you are examining has already been encrypted. Most plaintext has biases or patterns that can be detected, but those techniques are not guaranteed to work in general. You need to add additional structure to the ciphertext (or the plaintext), for example each ciphertext message or block begins with a 128-bit pattern.