简体   繁体   中英

How can I encrypt file in the iOS app's bundle to prevent data from copy?

How can I encrypt file in the iOS app's bundle to prevent data from copy? I can suggest to encode/decode it by simple rules. But it will take too much time to encode on every app start and it's not safe enough.

PS We should not cause export restrictions. So encrypting algorithm must be not strong.

The App Bundle can not be changed by the app so that option is not available.

If it is something that is included at build time you can encrypt it prior to building the app and decode it in the app when you need it.

The problem is that the encryption key must be provided to the app in some manner. Just including the key in the app code is not secure but may meet your needs. Providing the key from a web site with authentication might work for your needs.

You need to evaluate the level of security you require, who you are protecting against and how much effort/money they are willing to expend to get your data.

Note: encryption with Common Crypto is very fast. On an iPhone6 I benchmarked the speed as 1MB in 10.8 mSec or 92MB/sec.

Just use double encoding if data isn't too sensitive. For example, utf8 + base64 with several char replacements to hide that it's base64.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM