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

# Decrypt data

> Decrypt data with a KMS key from the Python SDK.

`client.kms.decrypt_data()` decrypts data that [`encrypt_data`](https://infisical.com/docs/sdks/languages/python/kms/encrypt) encrypted.

## Parameters

**key\_id** `str` *required*

The ID of the key that encrypted the data.

**ciphertext** `str` *required*

The encrypted data that `encrypt_data` returned.

## Returns

**plaintext** `str`

The decrypted data, encoded in base64.

```python Basic theme={"dark"}
import base64

plaintext = client.kms.decrypt_data(
    key_id="<key-id>",
    ciphertext=ciphertext,
)

print(base64.b64decode(plaintext).decode())
```

```json Response theme={"dark"}
"NDI0MiA0MjQyIDQyNDIgNDI0Mg=="
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.