How to check if file is encrypted with RNCryptor or not ?

261 views
Skip to first unread message

DT Quan

unread,
Jul 12, 2014, 11:23:40 PM7/12/14
to rncr...@googlegroups.com
I'm a iOS developer. I have a database file which is encrypted with RNCryptor.
My purpose is when app enter background, my database file will be encrypted, and when app back to foreground or active, my database file will be decrypted.
So, how to check if file is encrypted with RNCryptor or not ? (to avoid duplicate decrypting, encrypting)

Rob Napier

unread,
Sep 16, 2014, 8:36:18 AM9/16/14
to rncr...@googlegroups.com
There is no really useful header in the v3 RNCryptor format (it's something I've baked into the v4 format, but progress is slow on that). First, this is the kind of thing that is really better done with iOS's built-in data protection rather than with RNCryptor, but I've seen people who want RNCryptor for this for various reasons. My recommendation, if you are going to read and write the file, is to give the encrypted version a different filename extension. In any case, if you're ever writing the unencrypted version to disk, it's a big risk. It's going to be left there even if you try to overwrite it or delete it. That's one of many reasons to use the data protection system rather than trying to encrypt it yourself.

-Rob

Rob Napier

unread,
Sep 16, 2014, 8:39:18 AM9/16/14
to rncr...@googlegroups.com
BTW, I think I've now answered this question twice. I realized that the settings for this group were defaulting to private replies. I've adjusted the settings so they go to the group by default.

-Rob

Udo Thiel

unread,
Apr 17, 2016, 10:11:27 PM4/17/16
to rncryptor


On Tuesday, 16 September 2014 14:36:18 UTC+2, Rob Napier wrote:
There is no really useful header in the v3 RNCryptor format (it's something I've baked into the v4 format, but progress is slow on that). 

Now that V4 is finalized, how would an encryption check look like? 

Rob Napier

unread,
Apr 17, 2016, 10:23:49 PM4/17/16
to rncr...@googlegroups.com
These are different meanings of v4. The "RNCryptor v4" that came out this year is a Swift implementation of the RNCryptor v3 format. There isn't an implementation of the v4 format yet.

-Rob

Reply all
Reply to author
Forward
0 new messages