I have an iOS7 app that uses RNCryptor to keep it's documents all safely tucked up and secure.
Problem is, as the app is slightly paranoid, it uses the encryption quite liberally which seems to be resulting in the occasional double encryption. (For complicated reasons to do with backgrounding and/or terminating mainly.)
Is there a simple way of having a look at my files and testing to see if they've already encrypted (by the app itself) ?
UPDATE: In the end I went for the very basic option of attempting a decryption. If not encrypted it results in an error code 2 "Unknown header" which means it's not encrypted.
Add a sentinel to the beginning of the encrypted data after encryption. Prior to encryption test for the sentinel, if present don't encrypt, else encrypt and add the sentinel.
On decryption remove the sentinel prior to decryption.
Such pre-pending is not uncommon, many times the iv
is prepended.
Since encrypted data is indistinguishable from randon data and the algorythm is the same across implementations there is no signature of the spicific implementation that performed the encryption.