Reputation: 13
We have an application for ios Finally - we did our codesigning, but i would like to add an extra security check - within the executable itself.
I know apple had signed the app.How to get apple signed info in my app? Such as apple public key or something else?
Upvotes: 1
Views: 667
Reputation: 2616
You shouldn't try to make assumptions about Apple's Fairplay DRM, assuming you intend to validate it, there is no way for you to do this without having Apple's keys, but there are other indicators for tampering/piracy that I assume you are looking for.
There are several ways to check if your app has been tampered with. Let's assume that Apple's Fairplay DRM is secure, then if you detect your app running unencrypted, its very likely it was tampered with, and more likely that it was pirated. You can check for the cryptid
bit in the LC_ENCRYPTION_INFO
segment (more on this here). But keep in mind that piracy tools are a lot more sophisticated nowadays, and many will patch the cryptid
value at runtime. You could probably use the dyld_*
APIs to check for loaded libraries, and if the cryptid
hacker is loaded your app is probably compromised. They can of course change the name of the library, and you're back to square one. They can always change the value of the cryptid
bit on disk while the app is running, and switch it back when the app terminates.
So while you have several avenues to explore, in actuality, there's nothing you can do. Apple has tried to prevent jailbreaking via technical and legal measures, but they have failed. And as long as you can jailbreak, you can tamper with binaries in these ways.
Upvotes: 1