0
votes

In my app I display HTML content in a UIWebView. The HTML content is downloaded from a server and stored in the iPad's file system to enable offline usage. The HTML uses custom fonts via @font-face in it's CSS file:

@font-face {font-family: 'CustomFont'; src: url(Custom-Font.otf);}

To make this work, the font .otf file is also downloaded and stored in the iPad's filesystem.

The problem is, that now the font is available to anyone who can access his iPad's file system (which is really easy if you use something like IExplorer).

This leads to some legal problems, as most font providers do not allow that their fonts are freely distributed (which they practically are when I use this method).

My question: Is there any way, how I could keep the fonts encrypted in the filesystem and decrypt them when the UIWebView tries to load them?

3
Have you discussed this with your font providers? Obviously a mechanism for distributing the fonts that you have licensed has to be part of their considerations. Just because you provided the otf file doesn't mean that the recipient is licensed to use it for other purposes. Questions of the contract terms should be addressed to your lawyer and the lawyer of the font licensor.Rob Napier
That's a good point. I will do that.joern

3 Answers

0
votes

See Protecting Data Using On-Disk Encryption in the "iOS App Programming Guide":

In iOS 4 and later, apps can use the data protection feature to add a level of security to their on-disk data. Data protection uses the built-in encryption hardware present on specific devices (such as the iPhone 3GS and iPhone 4) to store files in an encrypted format on disk. While the user’s device is locked, protected files are inaccessible even to the app that created them. The user must explicitly unlock the device (by entering the appropriate passcode) at least once before your app can access one of its protected files.

I did not test this but I would strongly assume that the encrypted files cannot be read with iExplorer.

0
votes

I found a solution that works really well: Robin Summerhill wrote a great tutorial on how to protect resources in your iOS App using Apple's CommonCrypto API and Custom URL protocols. You can use that to encrypt all your embedded resources and it works with fonts, too.

0
votes

If you don't have a license from your font provider to redistribute their fonts, then by embedding them into your application, you are committing copyright infringement. Encrypting the files isn't going to change this.