Skip to main content

Decrypt

Removes password protection from encrypted PDF files, allowing unrestricted access and enabling further processing.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • PDF Path - Path to the encrypted PDF file to decrypt.

Options

  • PDF Path to Save - Output path where the decrypted PDF will be saved. If not provided, the original file is decrypted in place.
  • Mode - Encryption algorithm used by the PDF. Options: AES or RC4. Default is AES.
  • Key Length - Encryption key length in bits used by the PDF. Options: 40, 128, or 256. Default is 256.
  • Owner Password - Owner password for the encrypted PDF. Required if the PDF has owner password protection.
  • User Password - User password for the encrypted PDF. Required if the PDF has user password protection.
note

You must provide the correct password(s) that were used to encrypt the PDF. The mode and key length should match the encryption settings used when the PDF was encrypted.

Output

This node does not produce any output variables. The decrypted PDF is saved to the specified path or overwrites the original.

How It Works

The Decrypt node removes password protection from PDF files. When executed, the node:

  1. Validates the input PDF path
  2. Retrieves the owner and user passwords from credentials
  3. Verifies the encryption mode and key length settings
  4. Attempts to decrypt the PDF using the provided passwords
  5. Removes all encryption from the PDF
  6. Saves the decrypted PDF to the output path or overwrites the original

Understanding PDF Encryption

PDFs can be encrypted with two types of passwords:

  • User Password: Required to open the document
  • Owner Password: Grants full permissions including removing encryption

To decrypt a PDF, you need:

  • Either the user password OR the owner password
  • Correct encryption mode (AES or RC4)
  • Correct key length (40, 128, or 256 bits)

Use Cases

  • Automated Processing: Decrypt PDFs for processing in automated workflows
  • Content Extraction: Remove encryption to extract text, images, or data
  • Batch Operations: Decrypt multiple protected PDFs for bulk processing
  • Archive Access: Remove encryption from archived documents for easier access
  • Format Conversion: Decrypt before converting to other formats
  • Merging Operations: Decrypt PDFs before merging them together

Example Workflows

Basic Decryption

  1. Receive encrypted PDF file
  2. Retrieve password from Vault
  3. Use Decrypt node with correct password
  4. Process the decrypted PDF with other nodes

Batch Decryption

  1. Loop through directory of encrypted PDFs
  2. Decrypt each file with stored passwords
  3. Save decrypted versions to output directory

Decrypt for Processing

  1. Decrypt password-protected PDF
  2. Extract images or form data
  3. Process the extracted content
  4. Optionally re-encrypt the result

Determining Encryption Settings

If you're unsure about the encryption mode or key length:

  • Try AES with 256-bit first: Most common for modern PDFs
  • Try AES with 128-bit: Common for older PDFs
  • Try RC4 if AES fails: Used in legacy PDFs
  • Check with the document creator if possible

Error Handling

The node will return specific errors in the following cases:

  • Empty or invalid PDF path
  • PDF file not found at the specified path
  • PDF file is not encrypted (no decryption needed)
  • Incorrect password provided
  • Password retrieval fails from credential system
  • Incorrect encryption mode or key length specified
  • Insufficient permissions to read the PDF file
  • Insufficient permissions to write to output path or overwrite original
  • PDF is corrupted or damaged

Usage Notes

  • Original PDF remains unchanged when an output path is specified
  • Without an output path, the original file is overwritten with decrypted version
  • You must provide the correct password used during encryption
  • The mode and key length must match the encryption settings
  • If you only have the user password, you can still decrypt the PDF
  • Owner password provides full access for decryption
  • Lost passwords cannot be recovered by this node
  • After decryption, the PDF can be opened without any password
  • File size remains approximately the same after decryption

Tips for Effective Use

  • Backup First: Always backup encrypted files before decrypting in place
  • Use Vault: Store passwords securely in Robomotion Vault
  • Test Passwords: Verify passwords work before batch processing
  • Separate Output: Use output path to preserve encrypted originals
  • Match Settings: Ensure mode and key length match original encryption
  • Try Defaults: Start with AES/256-bit as most PDFs use these settings
  • Error Handling: Enable Continue On Error when processing multiple files with different passwords
  • Security: Securely delete decrypted files after processing if they contain sensitive data

Common Issues and Solutions

Issue: Incorrect Password Error

Solution:

  • Verify password is correct
  • Check that password is properly stored in Vault
  • Ensure you're using the right password type (owner vs user)

Issue: Decryption Fails with Correct Password

Solution:

  • Verify encryption mode (try both AES and RC4)
  • Try different key lengths (256, 128, or 40)
  • Check if PDF is corrupted

Issue: PDF Not Encrypted Error

Solution:

  • The PDF doesn't have password protection
  • No decryption is needed; use the PDF directly

Issue: Cannot Open Decrypted PDF

Solution:

  • Verify decryption completed successfully
  • Check that output file was created
  • Try opening with different PDF reader

Security Considerations

  1. Secure Credentials: Always use Vault for password storage
  2. Minimize Exposure: Delete decrypted files after processing
  3. Access Control: Restrict who can decrypt sensitive documents
  4. Audit Trail: Log decryption operations for compliance
  5. Temporary Files: Ensure decrypted temporary files are securely deleted
  6. Network Security: Avoid transmitting decrypted PDFs over unsecured connections

Encryption Settings Reference

ModeKey LengthCommon Usage
AES256-bitModern PDFs (most common)
AES128-bitStandard PDFs
RC4128-bitOlder PDFs
RC440-bitLegacy PDFs (rare)
  • Encrypt: Add password protection to PDF files
  • Change Password: Modify passwords without fully decrypting
  • Export To JSON: Extract form data (requires decryption first if encrypted)
  • Extract Images: Extract images (requires decryption first if encrypted)
  • Merge: Merge PDFs (decrypt encrypted files first)