Skip to main content
Module

x/simple_utility/src/crypto.ts

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

Functions

Derive SHA2 hash value from binary.

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

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

Generate exportable public-key pair. You can generate keys for ECDH or ECDSA. Algorithm use is "NIST P-512".

Create signature using private-key.

Verify signature using public-key.

Generate random binary with any number of bytes.

Type Aliases

Serialized CryptoKeyPair.