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

# decryptKeyShare

> Decrypts an encrypted key share

## Function Signature

```typescript theme={"system"}
decryptKeyShare(params: {
  keyShare: string;
  password: string;
}): Promise<any>
```

## Description

Decrypts an encrypted key share using the provided password. This function is used to recover key shares that were previously encrypted.

## Parameters

### Required Parameters

* **`keyShare`** (`string`) - The encrypted key share to decrypt
* **`password`** (`string`) - Password for decryption

## Returns

* **`Promise<any>`** - The decrypted key share

## Example

```typescript theme={"system"}
import { authenticatedSvmClient } from './client';

const svmClient = await authenticatedSvmClient();

const decryptedShare = await svmClient.decryptKeyShare({
  keyShare: 'encrypted-key-share-string',
  password: 'your-password',
});

console.log('Decrypted share:', decryptedShare);
```

## Error Handling

```typescript theme={"system"}
try {
  const decryptedShare = await svmClient.decryptKeyShare({
    keyShare: 'encrypted-key-share-string',
    password: 'your-password',
  });
  console.log('Key share decrypted successfully');
} catch (error) {
  if (error.message.includes('invalid password')) {
    console.error('Invalid password for decryption');
  } else {
    console.error('Failed to decrypt key share:', error);
  }
}
```

## Related Functions

* [`encryptKeyShare()`](/node/reference/svm/encrypt-key-share) - Encrypt a key share
* [`exportExternalServerKeyShares()`](/node/reference/svm/export-external-server-key-shares) - Export external server key shares
