Skip to content

Commit 354c3a7

Browse files
summerbluelifesign
authored andcommitted
encryption.md
1 parent cf4c9a5 commit 354c3a7

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

encryption.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
# Encryption
1+
# 加密
22

3-
- [Introduction](#introduction)
4-
- [Basic Usage](#basic-usage)
3+
- [介绍](#introduction)
4+
- [基本用法](#basic-usage)
55

66
<a name="introduction"></a>
7-
## Introduction
7+
## 介绍
88

9-
Lumen provides facilities for strong AES encryption via the Mcrypt PHP extension.
9+
Lumen 通过 Mcrypt PHP 扩充扩展包提供功能强大的 AES 加密功能。
1010

1111
<a name="basic-usage"></a>
12-
## Basic Usage
12+
## 基本用法
1313

14-
#### Encrypting A Value
14+
#### 加密
1515

16-
$encrypted = Crypt::encrypt('secret');
16+
$encrypted = Crypt::encrypt('secret');
1717

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 字符的随机字串,否则加密的数值不会安全。
1919
20-
#### Decrypting A Value
20+
#### 解密
2121

22-
$decrypted = Crypt::decrypt($encryptedValue);
22+
$decrypted = Crypt::decrypt($encryptedValue);
2323

24-
#### Setting The Cipher & Mode
24+
#### 配置密码与模式
2525

26-
You may also set the cipher and mode used by the encrypter:
26+
您也可以使用加密器来配置密码和模式:
2727

28-
Crypt::setMode('ctr');
28+
Crypt::setMode('ctr');
2929

30-
Crypt::setCipher($cipher);
30+
Crypt::setCipher($cipher);

0 commit comments

Comments
 (0)