# @lindorm-io/crypto

> Simplified crypto handlers for lindorm.io

Latest version **0.3.2** (published 2024-01-12) · AGPL-3.0-or-later license · 0 weekly downloads

## Install

```sh
npm install @lindorm-io/crypto
pnpm add @lindorm-io/crypto
yarn add @lindorm-io/crypto
bun add @lindorm-io/crypto
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2024-01-12 |
| First published | 2020-10-30 |
| Weekly downloads | 0 |
| License | AGPL-3.0-or-later |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 56 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | princejonn |

## Links

- npm: https://www.npmjs.com/package/@lindorm-io/crypto
- npm.io page: https://npm.io/package/@lindorm-io/crypto

## Dependencies (4)

- [argon2](https://npm.io/package/argon2.md) ^0.31.2
- [@lindorm-io/aes](https://npm.io/package/@lindorm-io/aes.md) ^0.3.0
- [@lindorm-io/core](https://npm.io/package/@lindorm-io/core.md) ^0.8.11
- [@lindorm-io/errors](https://npm.io/package/@lindorm-io/errors.md) ^0.1.21

## Recent versions

- 0.3.2 (latest) — 2024-01-12
- 0.3.1 — 2023-12-21
- 0.3.0 — 2023-12-14
- 0.2.0 — 2023-12-02
- 0.1.34 — 2023-11-06
- 0.1.33 — 2023-04-01
- 0.1.32 — 2023-03-30
- 0.1.31 — 2023-03-26
- 0.1.30 — 2023-03-24
- 0.1.29 — 2023-03-01
- 0.1.28 — 2023-02-02
- 0.1.27 — 2023-02-01
- 0.1.26 — 2023-01-18
- 0.1.25 — 2023-01-15
- 0.1.24 — 2023-01-15
- … 26 more at https://npm.io/package/@lindorm-io/crypto/versions

## README

# @lindorm-io/crypto

Simplified crypto handlers for lindorm.io packages

## Installation

```shell script
npm install --save @lindorm-io/crypto
```

## Usage

### CryptoAES

Wraps the crypto-js AES functions in a simple helper class

```typescript
const aes = new CryptoAES({
  secret: "secret",
});
const signature = aes.encrypt("input");

const valid = aes.verify("input", signature);
const decrypted = aes.decrypt(signature);
aes.assert("input", signature);
```

### CryptoSHA

Wraps the crypto-js SHA functisns in a simple helper class

```typescript
const sha = new CryptoSHA({
  secret: "secret",
});
const signature = sha.encrypt("input");

const valid = sha.verify("input", signature);
sha.assert("input", signature);
```

### CryptoArgon

Wraps the argon2 functions in a simple helper class

```typescript
const argon = new CryptoArgon();
const signature = await argon.encrypt("input");

const valid = await argon.verify("input", signature);
await argon.assert("input", signature);
```

### CryptoPassword

Wraps passwords in an onion using CryptoAES, CryptoSHA, and CryptoArgon.

```typescript
const password = new CryptoPassword({
  aesSecret: "aes-secret",
  shaSecret: "sha-secret",
});
const signature = await password.encrypt("input");

const valid = await password.verify("input", signature);
await password.assert("input", signature);
```

### CryptoSecret

Wraps secrets in an onion using CryptoAES and CryptoSHA.

```typescript
const secret = new CryptoSecret({
  aesSecret: "aes-secret",
  shaSecret: "sha-secret",
});
const signature = await secret.encrypt("input");

const valid = await secret.verify("input", signature);
await secret.assert("input", signature);
```

---
_Source: https://npm.io/package/@lindorm-io/crypto · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
