# `AshCloak`
[🔗](https://github.com/ash-project/ash_cloak/blob/v0.2.1/lib/ash_cloak.ex#L5)

An extension for encrypting attributes of a resource.

See the getting started guide for more information.

# `cloak`
*macro* 

# `encrypt_and_set`

```elixir
@spec encrypt_and_set(Ash.Changeset.t(), attr :: atom(), term :: term()) ::
  Ash.Changeset.t()
```

Encrypts and writes to an encrypted attribute.

If the changeset is pending (i.e not currently running the action), then it is added as a before_action hook.
Otherwise, it is run immediately

Raises AshCloak.Errors.NoSuchEncryptedAttribute if the attribute is not configured for encryption.

---

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