UNPKG

@izzius94/crypter

Version:

The crypter library makes easy to share encrypted data with a Laravel project.

21 lines (20 loc) 798 B
/// <reference types="node" /> import { algorithm } from './key'; /** * Decrypt an encrypted string * * @param encrypted The encrypted string to decrypt * @param key The key to use to decrypt the string, must be the same used during encryption * @param algorithm The algorithm to use use to decrypt the string, must be the same used during encryption * @returns The string decrypted */ export declare const decrypt: (encrypted: string, key: Buffer, algorithm?: algorithm) => string; /** * Enctypt a string * * @param value The value to encrypt * @param key The key to use to encrypt the string * @param algorithm The algorithm to use to encrypt the string * @returns The string encrypted */ export declare const encrypt: (value: string, key: Buffer, algorithm?: algorithm) => string;