Methods
Static decrypt
- decrypt(enctext: string, cryptkey: string | Buffer, cipher?: Cipher, containsIV?: boolean, iv?: string | Buffer): string
-
Parameters
-
enctext: string
-
cryptkey: string | Buffer
-
Default value cipher: Cipher = Cipher.DEFAULT
-
Default value containsIV: boolean = false
-
Optional iv: string | Buffer
Returns string
Static decryptRandomIV
- decryptRandomIV(enctext: string, cryptkey: string | Buffer, cipher?: Cipher): string
-
Parameters
-
enctext: string
-
cryptkey: string | Buffer
-
Default value cipher: Cipher = Cipher.DEFAULT
Returns string
Static encrypt
- encrypt(text: string, cryptkey: string | Buffer, cipher?: Cipher, iv?: string | Buffer, addIV?: boolean): Promise<string>
-
Parameters
-
text: string
-
cryptkey: string | Buffer
-
Default value cipher: Cipher = Cipher.DEFAULT
-
Default value iv: string | Buffer = AESCrypt.DEFAULT_IV
-
Default value addIV: boolean = false
Returns Promise<string>
Static encryptRandomIV
- encryptRandomIV(text: string, cryptkey: string | Buffer, cipher?: Cipher): Promise<string>
-
Parameters
-
text: string
-
cryptkey: string | Buffer
-
Default value cipher: Cipher = Cipher.DEFAULT
Returns Promise<string>
Decrypts an AES encrypted text
AESCrypt