# `Cryppo.DerivedKey`
[🔗](https://github.com/leikind/cryppo_ex/blob/main/lib/cryppo/derived_key.ex#L1)

A struct for a derived encryption key and its derivation artefacts

A `Cryppo.EncryptedData` struct may be marked as belonging to a certain key derivation strategy
using field `key_derivation_strategy` containing the module of the key derivation.

A `Cryppo.DerivedKey` comes in 2 flavors:

* With a derived encryption key. When used for encryption or decryption this key will be used
* Without an encryption key. Encrypting or decrypting with this struct requires a passphrase to derive the key

# `t`

```elixir
@type t() :: %Cryppo.DerivedKey{
  encryption_key: Cryppo.EncryptionKey.t() | nil,
  hash: String.t(),
  iter: integer(),
  key_derivation_strategy: Cryppo.encryption_strategy_module(),
  length: integer(),
  salt: binary()
}
```

Struct `Cryppo.DerivedKey`

A `Cryppo.DerivedKey` struct contains

* `encryption_key` - `nil` or a `Cryppo.EncryptionKey`
* `key_derivation_strategy` - module of the key derivation strategy
* `salt` - salt used for key derivation
* `iter` - number of iterations for key derivation
* `length` - key length
* `hash` - hash function for key derivation

# `current_version`

```elixir
@spec current_version() :: &lt;&lt;_::8&gt;&gt;
```

# `load_artefacts`

---

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