LibreOffice File Encryption Algorithms Explained

LibreOffice employs industry-standard cryptographic protocols to protect sensitive documents from unauthorized access. This article details the primary encryption algorithms, hashing methods, and key derivation standards utilized by LibreOffice, focusing on modern OpenDocument Format (ODF) specifications, legacy compatibility, and alternative security features like OpenPGP.

Modern ODF Encryption: AES-256

The default format for LibreOffice is the OpenDocument Format (ODF). Starting with ODF 1.2 and continuing into ODF 1.3 and later specifications, LibreOffice relies on strong symmetric encryption:

How LibreOffice Encrypts Files

LibreOffice documents (such as .odt, .ods, and .odp) are structured as compressed ZIP archives containing XML streams, embedded media, and metadata.

When a user enables password protection: 1. Manifest File: The META-INF/manifest.xml file remains unencrypted so the application can read the cryptographic parameters (such as the algorithm used, initialization vectors, salt, and iteration counts). 2. Component Encryption: Content streams (like content.xml, styles.xml, and embedded images) are individually encrypted using the derived AES-256 key and unique initialization vectors (IVs). 3. MIME Type: The mimetype file remains unencrypted to allow operating systems and file managers to identify the file format without decrypting it.

Legacy Algorithms and Compatibility

For backward compatibility with older ODF versions (ODF 1.1 and earlier) and legacy software, older LibreOffice and OpenOffice releases supported:

Modern versions of LibreOffice can still open these legacy encrypted files, but will upgrade them to AES-256 upon re-saving if modern ODF compatibility settings are selected.

Microsoft Office Format Compatibility

When saving password-protected files in Microsoft formats (such as .docx, .xlsx, or .pptx), LibreOffice implements the ECMA-376 Agile Encryption standard:

This ensures seamless cross-platform security between LibreOffice and Microsoft Office applications.

OpenPGP (GPG) Public-Key Encryption

In addition to symmetric password protection, LibreOffice supports OpenPGP (GPG) encryption and digital signatures. Users can encrypt documents using public keys stored in their local GnuPG keyring. This approach uses asymmetric cryptography (such as RSA or ECC) to secure the document key, ensuring that only holders of the corresponding private key can decrypt the file.