Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/simple_utility/src/crypto.ts

Useful snippet collection.
Go to Latest
import * as simpleUtility from "https://deno.land/x/simple_utility@v1.4.4/src/crypto.ts";

Functions

Derive SHA2 hash value from binary.

Generate random binary with any number of bytes.

Decrypt binary. Algorithm is AES-GCM with 128 bits key, 128 bits tag and 96 bits IV. IV is read from head of cipher.

Encrypt binary. Algorithm is AES-GCM with 128 bits key, 128 bits tag and 96 bits IV. IV is prepended to cipher.

Generate exportable public-key pair for ECDH. Curve algorithm is "NIST P-256".

Generate exportable public-key pair for ECDSA. Curve algorithm is "NIST P-256".

Create signature using private-key.

Verify signature using public-key.

Type Aliases

Serialized CryptoKeyPair.