> For the complete documentation index, see [llms.txt](https://wiki.4thtech.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.4thtech.io/sdk-and-white-label/encryption-1/encryption-handler/decrypt.md).

# decrypt

{% hint style="info" %}
Reference for SDK 0.5.x (maintenance mode). See [Status](/sdk-and-white-label/status.md).
{% endhint %}

Decrypts the provided encrypted data using the associated encryption metadata.

### Usage

```ts
import { EncryptionMetaData, EncryptionType } from '@4thtech-sdk/types';

const encryptedData = new ArrayBuffer(8);
const metadata: EncryptionMetaData = {
  type: '4th-tech-aes-gcm',
};
const decryptedData = await encryptionHandler.decrypt(encryptedData, metadata);
```

### Returns

`Promise<ArrayBuffer>`

A promise that resolves with the decrypted version of the provided encrypted data. The decrypted data will match the original content before it was encrypted, and it will be in the ArrayBuffer format.

### Parameters

#### data

* **Type** `ArrayBuffer`

The encrypted data that you want to decrypt. This data should have been encrypted using one of the encryption types supported by the EncryptionHandler.

#### encryptionMetaData

* **Type** `EncryptionMetaData`

The metadata associated with the encrypted data. This metadata provides details about how the data was encrypted, and is crucial for successfully decrypting it.

You can access metadata using the `getMetadata()` method on encryption instance.
