# Class EncryptUtil

CryptoES 加密库封装 https://github.com/entronad/crypto-es

安装第三方库生效 npm install -g yarn yarn add crypto-es

#### Hierarchy

- EncryptUtil

- Defined in assets/core/utils/EncryptUtil.ts:18

#####
Index

### Constructors

constructor

### Properties

JsonFormatter
iv
key

### Methods

aesDecrypt
aesEncrypt
initCrypto
md5

## Constructors

### constructor

- new EncryptUtil(): EncryptUtil

- #### Returns EncryptUtil

## Properties

### `Static` `Private` JsonFormatter

JsonFormatter: {
parse: ((jsonStr: any) => CipherParams);
stringify: ((cipherParams: any) => string);
} = ...

#### Type declaration

- ##### parse: ((jsonStr: any) => CipherParams)

  - - (jsonStr: any): CipherParams

    - #### Parameters

      - ##### jsonStr: any

      #### Returns CipherParams

- ##### stringify: ((cipherParams: any) => string)

  - - (cipherParams: any): string

    - #### Parameters

      - ##### cipherParams: any

      #### Returns string

- Defined in assets/core/utils/EncryptUtil.ts:71

### `Static` `Private` iv

iv: WordArray = ...

- Defined in assets/core/utils/EncryptUtil.ts:20

### `Static` `Private` key

key: string = ...

- Defined in assets/core/utils/EncryptUtil.ts:19

## Methods

### `Static` aesDecrypt

- aesDecrypt(str: string, key: string, iv: string): string

- AES 解密

  #### Parameters

  - ##### str: string

    解密字符串

  - ##### key: string

    aes加密的key

  - ##### iv: string

    aes加密的iv

  #### Returns string

  - Defined in assets/core/utils/EncryptUtil.ts:59

### `Static` aesEncrypt

- aesEncrypt(msg: string, key: string, iv: string): string

- AES 加密

  #### Parameters

  - ##### msg: string

    加密信息

  - ##### key: string

    aes加密的key

  - ##### iv: string

    aes加密的iv

  #### Returns string

  - Defined in assets/core/utils/EncryptUtil.ts:42

### `Static` initCrypto

- initCrypto(key: string, iv: string): void

- 初始化加密库

  #### Parameters

  - ##### key: string

  - ##### iv: string

  #### Returns void

  - Defined in assets/core/utils/EncryptUtil.ts:31

### `Static` md5

- md5(msg: string): string

- MD5加密

  #### Parameters

  - ##### msg: string

    加密信息

  #### Returns string

  - Defined in assets/core/utils/EncryptUtil.ts:26

Generated using TypeDoc