---
title: "Decrypt PDF on Android with AES | Nutrient SDK"
canonical_url: "https://www.nutrient.io/guides/android/document-security/decrypt-aes-files/"
md_url: "https://www.nutrient.io/guides/android/document-security/decrypt-aes-files.md"
last_updated: "2026-06-09T10:25:14.336Z"
description: "Nutrient supports fast, in-memory AES-256 decryption using the AesDataProvider class. Unlike other solutions, the PDF is never fully decrypted."
---

# Decrypt PDFs with AES on Android

Nutrient supports fast, in-memory [AES-256](http://en.wikipedia.org/wiki/AES256) decryption using the [`AesDataProvider`](https://www.nutrient.io/guides/android/security/aesdataprovider/) class. Unlike other solutions, the PDF is never _fully_ decrypted, and this even works with very large (> 500&nbsp;MB) documents. The file also will never be written out unencrypted to disk. For information on how to encrypt PDF files so they can be used by the `AesDataProvider` class, see our [encrypt with AES](https://www.nutrient.io/guides/android/security/aesdataprovider.md) guide.

## How to decrypt documents

You can decrypt your PDF in Nutrient with the `AesDataProvider` using the Base64 key you used to encrypt it:

### JAVA

```java

private static final String encryptedPDF = "/sdcard/encrypted.pdf";

// This is the 256-bit AES encryption key stored encoded as Base64. In production apps, this should be secured!
private static final String base64Key = "EQQlw3SNbBwbxkSi1jwwib4B4XqesCVDZv9LftsmE1U=";

AesDataProvider provider = new AesDataProvider(encryptedPDF, base64Key);

```

### KOTLIN

```kotlin

const val encryptedPDF = "/sdcard/encrypted.pdf"

// This is the 256-bit AES encryption key stored encoded as Base64. In production apps, this should be secured!
const val base64Key = "EQQlw3SNbBwbxkSi1jwwib4B4XqesCVDZv9LftsmE1U="

val provider = AesDataProvider(encryptedPDF, base64Key)

```

For more information about this process, take a look at `AesEncryptedFileExample.java` in our [Catalog example app](https://github.com/PSPDFKit/pspdfkit-android-catalog/blob/9eac1be5767cdeb5a58d879d0749c2338d4f77fb/app/src/main/java/com/pspdfkit/catalog/examples/java/decryption/AesEncryptedFileExample.java).
---

## Related pages

- [Encrypt PDFs with AES on Android](/guides/android/security/aesdataprovider.md)
- [Creating password-protected PDFs on Android](/guides/android/document-security/add-a-password.md)
- [Secure your PDFs with custom watermarks on Android](/guides/android/document-security/add-a-watermark.md)
- [Document security on Android](/guides/android/document-security.md)
- [Introduction to PDF encryption on Android](/guides/android/security/introduction-to-encryption.md)
- [Prevent sharing of PDF files on Android](/guides/android/document-security/prevent-sharing.md)
- [Manage PDF document permissions on Android](/guides/android/features/document-permissions.md)

