# AesGcm.fromMnemonic

Derives an AES-256-GCM key from a BIP-39 mnemonic.

This is equivalent to passing `Mnemonic.toSeed(mnemonic, { passphrase })` to [`AesGcm.fromSeed`](/api/AesGcm/fromSeed).

## Imports

:::code-group
```ts [Named]
import { AesGcm } from 'ox'
```

```ts [Entrypoint]
import * as AesGcm from 'ox/AesGcm'
```
:::

## Examples

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

const key = await AesGcm.fromMnemonic(
  'test test test test test test test test test test test junk'
)
```

## Definition

```ts
function fromMnemonic(
  mnemonic: string,
  options?: fromMnemonic.Options,
): Promise<CryptoKey>
```

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

## Parameters

### mnemonic

* **Type:** `string`

BIP-39 mnemonic phrase.

### options

* **Type:** `fromMnemonic.Options`
* **Optional**

Options.

#### options.passphrase

* **Type:** `string`
* **Optional**

Optional BIP-39 passphrase.

## Return Type

A nonextractable AES-256-GCM key for encryption and decryption.

`Promise<CryptoKey>`
