[**Documentation**](../../../README)

***

[Documentation](../../../README) / [@zerotal/core](../README) / security

# security

Security primitives for Zerotal (the `@zerotal/core/security` subpath):
[Crypt](variables/Crypt) for `APP_KEY`-keyed AES-256-GCM encryption and [Hash](variables/Hash) for
argon2id/bcrypt password hashing. Both are zero-config facades — no provider
registration required — that read `APP_KEY` from the environment on first use.

## Example

```ts
import { Crypt, Hash } from "@zerotal/core/security";

const token = Crypt.encryptString("secret");
Crypt.decryptString(token); // "secret"

const digest = await Hash.make("hunter2");
await Hash.verify("hunter2", digest); // true
```

## Classes

- [CryptKeyMissingError](classes/CryptKeyMissingError)
- [DecryptionError](classes/DecryptionError)

## Type Aliases

- [HashAlgorithm](type-aliases/HashAlgorithm)

## Variables

- [Crypt](variables/Crypt)
- [Hash](variables/Hash)
