Skip to main content
Module

x/easysecurity/mod.ts>Crypter

Basic security API for Typescript that optimizes for easy use
Go to Latest
class Crypter
import { Crypter } from "https://deno.land/x/easysecurity@0.1.4/mod.ts";

Constructors

new
Crypter(key: Key, iv: IV)

Properties

readonly
iv: IV
readonly
key: Key

Methods

decryptFromHex(hexEncrypted: string): Promise<string>

decrypt a hex-encoded encryption output and return the original clear text

encryptToHex(clearText: string): Promise<string>

encrypt a clear text and hex-encode the resulting encrypted value

Static Methods

fromHex(hexKey: string, hexIV: string): Promise<Crypter>

construct a new Crypter using a hex-encoded Key and IV

generate(): Promise<Crypter>

construct a new Crypter using newly generated Key and IV