---
title: "What does “CDFV2 Encrypted” mean?"
url: https://recursiveai.org/onedocument/articles/cdfv2-encrypted-office-files/
description: "“CDFV2 Encrypted” describes an encrypted file in a compound container. It doesn’t tell you whether the Office file inside is Word, Excel, or PowerPoint."
date: 2026-11-19
author: OneDocument team
---

# What does “CDFV2 Encrypted” mean?

“CDFV2 Encrypted” describes an encrypted file in a compound container. It doesn’t tell you whether the Office file inside is Word, Excel, or PowerPoint.

November 19, 2026 · OneDocument team · Updated · November 19, 2026

[OneDocument](https://recursiveai.org/onedocument/) is Recursive AI’s free, open-source ([MIT or Apache-2.0](https://licenses.nuget.org/MIT%20OR%20Apache-2.0)) .NET library for Word, Excel, and PowerPoint files. [NuGet](https://www.nuget.org/packages/RecursiveAI.OneDocument/1.0.0) · [GitHub](https://github.com/recursive-ai-oss/onedocument-csharp) · [Docs](https://recursiveai.org/onedocument/docs/)

*Install · .NET 10*

```
dotnet new console
dotnet add package RecursiveAI.OneDocument --version 1.0.0
```

## The short answer

“CDFV2 Encrypted” can mean a password-protected Office document or another encrypted compound file; if it’s password-protected, you need the password to identify the format inside.

The Unix `file` command (`file(1)` in the manual) uses CDF for Compound Document File: a container with named streams, much like files within a folder. CDFV2 isn’t a filename extension, and it doesn’t name the encryption algorithm. A modern Office file can have its entire package encrypted inside this container, while older binary Office formats such as DOC and XLS can also use compound storage without being encrypted.

Download [`secret-basic.docx`](https://raw.githubusercontent.com/recursive-ai-oss/onedocument-csharp/a85720e075c783fc596641d8586ee126cae088c5/testdata/encryption/secret-basic.docx) into the project folder. This first example identifies the wrapper without opening the contents.

Replace `Program.cs` and run `dotnet run`.

*Program.cs*

```
using RecursiveAI.OneDocument;
 
Console.WriteLine(Office.Detect("secret-basic.docx"));
```

*Output*

```
EncryptedPackage
```

## Can the label tell you which Office format is inside?

No. For password-encrypted modern Office packages, the compound file holds an `EncryptionInfo` stream and an `EncryptedPackage` stream. The first describes how the package was encrypted; the second holds the encrypted package. The same arrangement can hold a Word document, an Excel workbook, or a PowerPoint presentation. See [Microsoft’s Office encryption specification](https://learn.microsoft.com/en-us/openspecs/office_file_formats/ms-offcrypto/) and [OneDocument’s container detection](https://github.com/recursive-ai-oss/onedocument-csharp/blob/a85720e075c783fc596641d8586ee126cae088c5/src/OneDocument/Formats/FormatSniffer.cs#L403-L424).

For example, `file` 5.46 gives the same label to the pinned [Word fixture](https://raw.githubusercontent.com/recursive-ai-oss/onedocument-csharp/a85720e075c783fc596641d8586ee126cae088c5/testdata/encryption/secret-basic.docx) and [Excel fixture](https://raw.githubusercontent.com/recursive-ai-oss/onedocument-csharp/a85720e075c783fc596641d8586ee126cae088c5/testdata/encryption/secret-basic.xlsx):

*Output · file(1)*

```
secret-basic.docx: CDFV2 Encrypted
secret-basic.xlsx: CDFV2 Encrypted
```

If the name is missing or unreliable, identify the inner format after opening the file with its password. Renaming the outer file won’t change what’s inside.

## Which encrypted Office files can OneDocument read?

- **Modern Office packages:** Agile and Standard AES encryption for DOCX, XLSX, PPTX, and XLSB.
- **Older binary Office files:** RC4 1.1 and RC4 CryptoAPI for XLS, DOC, and PPT; XOR obfuscation for XLS and DOC.

[The 1.0.0 scheme list](https://github.com/recursive-ai-oss/onedocument-csharp/blob/a85720e075c783fc596641d8586ee126cae088c5/docs/encryption.md#L5-L17) excludes certificate-only Agile, extensible encryption, and RC4 in an ECMA-376 package, among other cases. A correct password doesn’t make an unsupported scheme readable. [Browser WebAssembly](https://github.com/recursive-ai-oss/onedocument-csharp/blob/a85720e075c783fc596641d8586ee126cae088c5/docs/encryption.md#L39-L41) also lacks the AES and MD5 implementations this release needs for some schemes.

## What happens when the password is missing or wrong?

Pass the known password in `OpenContext.Password`. With a supported file that requires a user password, OneDocument raises `OfficeEncryptedException` if the password is missing or incorrect; the defect code distinguishes the two cases ([password handling](https://github.com/recursive-ai-oss/onedocument-csharp/blob/a85720e075c783fc596641d8586ee126cae088c5/docs/encryption.md#L1-L21)).

The `secret-basic.docx` fixture uses Standard encryption and the public sample password `secret`. Replace `Program.cs` with the example below and run `dotnet run`. It checks the decrypted bytes in memory without writing an unencrypted copy.

*Program.cs · .NET 10*

```
using RecursiveAI.OneDocument;
using RecursiveAI.OneDocument.Encryption;
using RecursiveAI.OneDocument.Formats;
using RecursiveAI.OneDocument.IO;
 
const string path = "secret-basic.docx";
Console.WriteLine($"Detected: {Office.Detect(path)}");
foreach (string? password in new string?[] { null, "wrong", "secret" })
{
    using var source = ByteSource.FromFile(path);
    try
    {
        byte[] package = PackageEncryption.DecryptCompoundFile(
            source, new OpenContext(password: password));
        Console.WriteLine($"Inner format: {FormatSniffer.Detect(package)}");
    }
    catch (OfficeEncryptedException ex)
    {
        Console.WriteLine(ex.Defect.Code);
    }
}
```

*Output*

```
Detected: EncryptedPackage
encryption.password-required
encryption.password-incorrect
Inner format: Docx
```

The first result identifies the outer Office wrapper. Only the last result identifies the document inside. For work with the opened document itself, see the [OneDocument encryption guide](https://recursiveai.org/onedocument/docs/encryption/) for the document, workbook, and presentation APIs.
