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

# encryptKeystoreJson

```ts theme={null}
function encryptKeystoreJson(
   account, 
   password, 
options?): Promise<string>
```

Resolved to the JSON Keystore Wallet for `account` encrypted with `password`.

The `options` can be used to tune the password-based key derivation function parameters, explicitly set the random
values used and provide a [**ProgressCallback**](/sdk/content/type-aliases/ProgressCallback) to receive periodic updates on the
completion status..

## Parameters

| Parameter  | Type                                                           | Description                                       |
| :--------- | :------------------------------------------------------------- | :------------------------------------------------ |
| `account`  | [`KeystoreAccount`](/sdk/content/type-aliases/KeystoreAccount) | The account to encrypt.                           |
| `password` | `string` \| `Uint8Array`                                       | The password to encrypt the JSON data.            |
| `options`? | [`EncryptOptions`](/sdk/content/type-aliases/EncryptOptions)   | The options to use when encrypting the JSON data. |

## Returns

`Promise`\<`string`>

The encrypted JSON data.

## Source

[wallet/json-keystore.ts:491](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/wallet/json-keystore.ts#L491)
