0.3.2 • Published 1 year ago

@lindorm-io/crypto v0.3.2

Weekly downloads
-
License
AGPL-3.0-or-later
Repository
-
Last release
1 year ago

@lindorm-io/crypto

Simplified crypto handlers for lindorm.io packages

Installation

npm install --save @lindorm-io/crypto

Usage

CryptoAES

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

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

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

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.

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.

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);
0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

2 years ago

0.1.34

2 years ago

0.2.0

2 years ago

0.1.30

2 years ago

0.1.31

2 years ago

0.1.32

2 years ago

0.1.33

2 years ago

0.1.29

2 years ago

0.1.27

2 years ago

0.1.28

2 years ago

0.1.20

2 years ago

0.1.21

2 years ago

0.1.22

2 years ago

0.1.23

2 years ago

0.1.24

2 years ago

0.1.25

2 years ago

0.1.26

2 years ago

0.1.19

2 years ago

0.1.18

3 years ago

0.1.17

3 years ago

0.1.12

3 years ago

0.1.13

3 years ago

0.1.14

3 years ago

0.1.15

3 years ago

0.1.16

3 years ago

0.1.10

3 years ago

0.1.11

3 years ago

0.1.8

3 years ago

0.1.9

3 years ago

0.1.7

3 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago