Skip to main content
Module

x/simple_utility/src/crypto.ts

A handy utility collection.
Go to Latest
import * as simpleUtility from "https://deno.land/x/simple_utility@v0.2.1/src/crypto.ts";

Functions

Decrypt encrypted byte array using AES, read the IV prepended to the byte array.

Encrypt byte array using AES, the IV is prepended to the byte array.

Generate and export public/private key pair as a portable byte array.

Derive SHA2 hash value from byte array.

Returns random byte array with the specified number of bytes.

Create byte array signature using the private key and SHA2 hash algorithm.

Returns random UUID.

Verifies the correct signature of a byte array using the public key and SHA2 hash algorithm.

Type Aliases

Means the byte array after exporting CryptoKey.

Each is PortableCryptoKey public/private key pair.