File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change 1
- # Encryption
1
+ # 加密
2
2
3
- - [ Introduction ] ( #introduction )
4
- - [ Basic Usage ] ( #basic-usage )
3
+ - [ 介绍 ] ( #introduction )
4
+ - [ 基本用法 ] ( #basic-usage )
5
5
6
6
<a name =" introduction " ></a >
7
- ## Introduction
7
+ ## 介绍
8
8
9
- Lumen provides facilities for strong AES encryption via the Mcrypt PHP extension.
9
+ Lumen 通过 Mcrypt PHP 扩充扩展包提供功能强大的 AES 加密功能。
10
10
11
11
<a name =" basic-usage " ></a >
12
- ## Basic Usage
12
+ ## 基本用法
13
13
14
- #### Encrypting A Value
14
+ #### 加密
15
15
16
- $encrypted = Crypt::encrypt('secret');
16
+ $encrypted = Crypt::encrypt('secret');
17
17
18
- > ** Note: ** Be sure to set a 32 character random string in the ` APP_KEY ` option of the ` .env ` file. Otherwise, encrypted values will not be secure.
18
+ > ** 注意: ** 请确保 ` config/app.php ` 文件中的 ` key ` 选项配置了 16, 24, 或 32 字符的随机字串,否则加密的数值不会安全。
19
19
20
- #### Decrypting A Value
20
+ #### 解密
21
21
22
- $decrypted = Crypt::decrypt($encryptedValue);
22
+ $decrypted = Crypt::decrypt($encryptedValue);
23
23
24
- #### Setting The Cipher & Mode
24
+ #### 配置密码与模式
25
25
26
- You may also set the cipher and mode used by the encrypter:
26
+ 您也可以使用加密器来配置密码和模式:
27
27
28
- Crypt::setMode('ctr');
28
+ Crypt::setMode('ctr');
29
29
30
- Crypt::setCipher($cipher);
30
+ Crypt::setCipher($cipher);
You can’t perform that action at this time.
0 commit comments