I mistakenly encrypted some of my values in the db twice. Is there a way to identify double encrypted ciphertext.
var ciphertext = cryptoJS.AES.encrypt(plainText, secretKey).toString();
var ciphertext2 = cryptoJS.AES.encrypt(ciphertext, secretKey).toString();
There are two ways to do this, and both are high certainty but have drawbacks.
First of all, if you don't give an well formatted key / IV then CryptoJS will use an OpenSSL key derivation mechanism to derive the key and IV. If you use toString() it will then stringify the result. This of course adds some overhead, so if you know the original size of the message then you can simply try and detect double encryption by the increase of the size.
Second, you can decrypt once, and then look for the format that toString generates. This is a base 64 string which, after decoding, should contain Salted__ in ASCII (followed by the salt and then the AES-CBC / PKCS#7 ciphertext). As your plaintext is unlikely to start with Salted__ this should be enough of a distinguisher. So your decrypt routine could run in a loop until the Salted__ string isn't found anymore.
Otherwise: AES encrypted ciphertext is fully randomized, so you cannot see anything looking at the ciphertext itself. In this case however, the ciphertext is part of a proprietary protocol, which opens up some possiblities.