---
title: "ezgh keys decrypt"
description: "Decrypt a ciphertext, from stdin or a file."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ezgh keys decrypt

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh keys decrypt [--file path] [--context key=value]... [flags]
```

Decrypt a ciphertext read from stdin or `--file`. It names its own key, so there's no key to give. The context must be the one it was sealed with. The plaintext goes to stdout, byte for byte; -o json gives it in base64, with the key's ID.

Part of [`ezgh keys`](/cli/reference/keys).

## Examples

```sh
ezgh keys decrypt --context tenant=acme < token.enc
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--context` | string, repeatable |  | encryption context; opening it needs the same one, key=value; repeat for more |
| `--context-file` | string |  | encryption context; opening it needs the same one, from a file holding a JSON object of strings |
| `--file` | string |  | read the ciphertext from this file instead of stdin |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/keys-decrypt/index.mdx
