Class Encryption
Protection ID: class_encryption
Class Encryption encrypts the Objective-C class metadata structures in your application binary. This prevents tools from enumerating classes, methods, and properties through the Objective-C runtime metadata without first decrypting these structures.
Configuration
{
"protections": {
"class_encryption": true
}
}{
"protections": {
"class_encryption": true
}
}How It Works
iOS applications built with Objective-C (or Swift with @objc bridging) contain rich class metadata in the __objc_classlist and related sections of the Mach-O binary. This metadata includes class names, method selectors, property lists, and protocol conformances. Tools like class-dump can extract this information to produce a complete header file for your application.
Class Encryption encrypts these metadata structures so they cannot be read directly from the binary. The metadata is decrypted at runtime when the Objective-C runtime needs to access it. Static analysis tools that rely on reading this metadata from the file will find encrypted data instead.
When to Use
Class Encryption is recommended for applications that rely heavily on Objective-C classes or use Swift with @objc bridging. It is especially valuable for applications where the class structure itself reveals sensitive information, such as proprietary framework architectures, payment processing systems, or DRM implementations.
For pure Swift applications, combine this with Swift Metadata Stripping for comprehensive metadata protection.
Related
- Swift Metadata Stripping - Remove Swift type metadata
- Resource Encryption - Encrypt bundled resources
- Protections Overview - All available protections