Skip to main content
Deno 2 is finally here 🎉️
Learn more
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.0.15/src/crypto.ts";

Functions

Decrypt encrypted byte array using AES-GCM with 256 bits key 128 bits tag and 96 bits IV. Read the IV prepended to the byte array.

Encrypt byte array using AES-GCM with 256 bits key, 128 bits tag and 96 bits IV. 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 SHA384 hash algorithm.

Returns random UUID.

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

Type Aliases

Means the byte array after exporting CryptoKey.

Each is PortableCryptoKey public/private key pair.