> For the complete documentation index, see [llms.txt](https://docs.duplicati.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.duplicati.com/using-tools/encrypting-and-decrypting-files.md).

# Encrypting and decrypting files

In normal Duplicati operations, the files at the remote destination should never be handled by anything but Duplicati. Changing the remote files will always result in warnings or errors when Duplicati needs to access those files.

However, in certain exceptional scenarios, it may be required that the file contents are accessed manually.

## Processing files encrypted with AES encryption

The files encrypted with the default AES encryption follows the [AESCrypt](https://www.aescrypt.com/aes_stream_format.html) file format, so [any tool that supports the AESCrypt file format](https://www.aescrypt.com/download/) can be used to decrypt and encrypt these files.

For convenience, Duplicati also ships with a command line binary named [SharpAESCrypt](/duplicati-programs/command-line-interface-cli-1/sharpaescrypt.md) that uses the same library that is used by Duplicati. This tool can be used to decrypt the remote volume files with the encryption passphrase, as well as encrypt files.

## Processing files encrypted with GPG encryption

Files encrypted with [GPG](https://www.gnupg.org/index.html) can choose one of the many ways, and a general overview of how GPG works can be found in the [GPG man-pages](https://www.gnupg.org/documentation/manuals/gnupg24/gpg.1.html). When using the default options, Duplicati will use the symmetric mode for GPG. In this mode, you can use this command to decrypt a file:

```
gpg -d volume.zip.gpg -o volume.zip
```

And similarly, to encrypt a file, you can use:

```
gpg --symmetric volume.zip -o volume.zip.gpg
```

## Re-compress and re-encrypt

If you need to switch from GPG to AES, or vice-versa, you can use the [Recovery Tool](/duplicati-programs/command-line-interface-cli-1/recoverytool.md) to automatically process all files on the storage destination. The recovery tool also supports recompressing or changing the compression method.

If you use this method, make sure to [recreate the local database](/using-tools/recovering-from-failure.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.duplicati.com/using-tools/encrypting-and-decrypting-files.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
