# Keystore Errors

## `Keystore.InvalidKeySizeError`

Thrown when a key contains fewer than 32 bytes.

### Examples

```ts twoslash
import { Keystore } from 'ox'

const [, opts] = Keystore.pbkdf2({
  password: 'testpassword'
})

Keystore.encrypt('0x01', '0x0123456789abcdef', opts)
// @error: Keystore.InvalidKeySizeError: Key must contain at least 32 bytes. Received 8 bytes.
```

**Source:** [src/core/Keystore.ts](https://github.com/wevm/ox/blob/main/src/core/Keystore.ts#L557)
