This repository has been archived by the owner on Aug 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,31 @@ | ||
# TaiNine | ||
|
||
一个简单的加密解密字符串的php文件 | ||
|
||
太难,因为有81个字符随机替换,能不难么。 | ||
|
||
#### 原理 | ||
|
||
将post的字符串转化成html实例格式(避免中文影响),变成一个长字符串,随机替换字符序列,且与字符长度位置有关,取81同余。 | ||
|
||
###### 函数 | ||
|
||
1.toHtml 转换成html实例格式。 | ||
|
||
2.backHtml 上个函数的逆函数。 | ||
|
||
3.encrypt 加密函数 | ||
|
||
4.decrypt 解密函数 | ||
|
||
示例: | ||
|
||
``` | ||
$tq=new TaiNine('你好'); | ||
$tq->encrypt(); //加密 | ||
echo $tq->encryptData."\r\n"; //加密结果 | ||
echo $tq->method."\r\n"; //加密方法 | ||
$tq->decrypt($tq->encryptData,$tq->method); //解密 | ||
echo $tq->decryptData."\r\n"; //还原 | ||
``` |