# `Grizzly.ZWave.CommandClasses.Security2`
[🔗](https://github.com/smartrent/grizzly/blob/v9.1.4/lib/grizzly/zwave/command_classes/security_2.ex#L1)

Security 2 (S2) Command Class

### Definitions

- **CKDF** - CMAC-based Key Derivation Function
- **MEI** - Mutual Entropy Input
- **SPAN** - Singlecast Pre-Agreed Nonce
- **MPAN** - Multicast Pre-Agreed Nonce
- **MGRP** - Multicast Group
- **SOS** - Singlecast Out-of-Sync
- **MOS** - Multicast Out-of-Sync

# `ecdh_profile`

```elixir
@type ecdh_profile() :: :curve_25519
```

# `kex_scheme`

```elixir
@type kex_scheme() :: :kex_scheme_1
```

# `ckdf_mei_expand`

```elixir
@spec ckdf_mei_expand(&lt;&lt;_::128&gt;&gt;, &lt;&lt;_::128&gt;&gt;) :: &lt;&lt;_::256&gt;&gt;
```

Mix and expand the sender and receiver entropy inputs into a nonce using CKDF-MEI.

# `ecdh_public_key`

Computes an ECDH public key for the given private key.

# `ecdh_public_key_to_dsk_string`

Encode the ECDH public key into a DSK string.

# `ecdh_shared_secret`

Computes the shared secret using the ECDH algorithm with the local node's
private key and the remote node's public key (as reported by S2 Public Key Report).

# `generic_expand`

Expands a network key into a CCM key for encryption and authorization, a
personalization string, and an MPAN key using the CKDF-Expand algorithm as
described in https://datatracker.ietf.org/doc/html/draft-moskowitz-hip-dex-02#section-6.3.

# `network_key_expand`

Expands a network key into a CCM key for encryption and authorization, a
personalization string, and an MPAN key using the CKDF-Expand algorithm as
described in https://datatracker.ietf.org/doc/html/draft-moskowitz-hip-dex-02#section-6.3.

# `temp_key_expand`

Expands a temporary network key into a CCM key for encryption and authorization, a
personalization string, and an MPAN key using the CKDF-Expand algorithm as
described in https://datatracker.ietf.org/doc/html/draft-moskowitz-hip-dex-02#section-6.3.

# `temp_key_extract`

```elixir
@spec temp_key_extract(&lt;&lt;_::256&gt;&gt;, &lt;&lt;_::256&gt;&gt;, &lt;&lt;_::256&gt;&gt;) :: &lt;&lt;_::128&gt;&gt;
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
