Resource Protection

Resource protection encrypts and compresses the embedded resources in your application, so an attacker cannot extract, read, or replace them.

  • .NET.NET
  • AndroidAndroid
  • AppleiOS
TL;DR

Resource protection encrypts the assets bundled inside your application: images, configuration files, data files, and other embedded resources. They are decrypted only at runtime when used. An attacker unpacking the application finds encrypted data instead of usable files.

Definition

What is resource protection?

Resource protection is a technique that secures the non-code assets embedded in an application. Most applications ship with bundled resources: images, data files, configuration, templates, and more.

By default these resources sit inside the application package in their original form. Anyone who unpacks the package can extract them, read them, and even swap them for modified versions.

Resource protection encrypts and compresses those embedded resources. They are stored in protected form and decrypted only at runtime when the application needs them, so they cannot be extracted or tampered with from the package.

Mechanism

How resource protection works

Resource protection transforms how embedded assets are stored:

  • Encryption at build time. Embedded resources are encrypted when the application is built.

  • Compression. Resources are compressed, reducing footprint and further obscuring their content.

  • Runtime decryption. A resource is decrypted only when the application accesses it.

The original assets never sit in readable form inside the shipped package.

Example

Resource protection example

The same bundled configuration, before and after resource protection. The application reads the same values; an attacker unpacking the package does not.

Original

An attacker unpacks the application package and extracts every embedded image, data file, and configuration file directly.

Encrypted

The same package contains encrypted, compressed resources. They are usable only at runtime, inside the application.

Original
{
  "apiUrl": "https://api.bytehide.com",
  "version": "1.4.2",
  "features": ["auth", "vault", "monitor"]
}
Encrypted
{
  "_data": "4f7ba918c23f5e7183d49a2e6fb147e0953c82a618f4297b5dc1a9...",
  "_alg": "AES-256-GCM",
  "_v": 1
}

Use cases

When to use resource protection

Resource protection is most useful when your application:

  • Embeds configuration or data files that reveal how it works.
  • Ships proprietary assets that should not be extracted or reused.
  • Must prevent embedded resources from being swapped for modified versions.

It pairs with anti-tamper: resource protection keeps assets confidential, anti-tamper ensures they have not been replaced.

Platform availability

Resource protection across platforms

  • .NET

    Encryption and compression of embedded resources.

  • Android

    Encryption of resources bundled in the APK.

  • iOS

    Encryption of bundled assets and resource files.

Frequently asked questions

What is resource protection?
Resource protection is a technique that encrypts and compresses the embedded assets in an application, such as images, data files, and configuration, so they cannot be extracted or swapped from the package.
Does resource protection affect performance?
The impact is small. Resources are decrypted only when accessed, and compression can even reduce load time.
Does resource protection reduce application size?
Compression often offsets the cost of encryption, so the protected package can be similar in size or smaller.
What resources should be protected?
Configuration files, data files, proprietary assets, and anything embedded that reveals how the application works or that should not be reused.
Which platforms support resource protection?
ByteHide Shield provides resource protection for .NET, Android, and iOS.
10,000+ developers and companies protect their applications with ByteHide

Protect your application with
ByteHide Shield

Resource protection is one of more than 20 protections in ByteHide Shield. Apply it to your .NET, Android, or iOS application.

ByteHide runtime dashboard showing live threat monitoring and protection metrics