import crypto from 'crypto' export function encrypt(str: string, secret: string = 'lego'): string { var cipher = crypto.createCipher('aes192',secret); var enc = cipher.update(str,'utf8','hex'); enc += cipher.final('hex'); return enc; } export function decrypt(str: string, secret = 'lego'): string { var decipher = crypto.createDecipher('aes192',secret); var dec = decipher.update(str,'hex','utf8'); dec += decipher.final('utf8'); return dec; }