> ## 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 Node.js SDK.

`client.kms().encryption().decrypt()` decrypts data that [`encrypt`](https://infisical.com/docs/sdks/languages/node/kms/encrypt) encrypted.

## Parameters

**options** `KmsDecryptDataOptions` *required*

**properties**

**keyId** `string` *required*

The ID of the key that encrypted the data.

**ciphertext** `string` *required*

The encrypted data that `encrypt` returned.

## Returns

**plaintext** `string`

The decrypted data, encoded in base64.

```typescript Basic theme={"dark"}
const plaintext = await client.kms().encryption().decrypt({
  keyId: "<key-id>",
  ciphertext,
});

console.log(Buffer.from(plaintext, "base64").toString());
```

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


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