PHP 常见的数据加密技术

单项散列加密技术(不可逆的加密)

把任意长的输入字符串变化为固定长的输出串的一种函数

MD5

string md5 ( string $str [, bool $raw_output = false ] ); // MD5加密,输入任意长度字符串返回一个唯一的32字符,第一个参数是需要加密的字符串,第二个为 raw_output 的布尔值,默认情况下false,当设置为true时,返回的是原始 16 字符的二进制格式

MD5() 是单向加密,没有逆向解密算法,但是可以通过对一些常见的字符串的收集、枚举、碰撞等方法破解;

所以为了让其破解起来更加麻烦一些,我们一般加一点盐值(salt) 并双重 MD5

md5(md5($password) . 'asd')

在这里 'asd' 就是盐值,盐值一般是随机的,MD5 常用在密码加密上,所以我们在设置密码的时候通常会随机

生成这个字符串然后再双重加密

Crypt

这个函数通常用在对称或非对称的算法里面

string crypt ( string $str [, string $salt ] ) //第一个为需要加密的字符串,第二个为盐值(就是加密干扰值,如果没有提供则由PHP自动生成) 

示例:

<?php
// 需要加密的字符串
$str = 'this is string';
// 使用crypt加密,不指定盐值
$res = crypt($str);

// 指定盐值,但是盐值只能写两位,如果超过了则会自动取前两位,在某些系统中则会直接返回FALSE

$res = crypt($str, 'ly');

关于这个函数的具体使用可以参考手册:http://www.runoob.com/php/func-string-crypt.html

 

Sha1加密

string sha1 ( string $str [, bool $raw_output = false ]);
// sha1 和 md5 很像,不同的是 sha1 默认情况下,返回40个字符串的散列值,传入参数性质一样,第一个为需要加密的字符串,第二个为 raw_output 的布尔值,默认情况下false,如果设置为true的时候,sha1 返回的是原始 20 字符的二进制格式

 示例:

<?php
$password = 'testtest.com';
echo sha1($password);//1e415fd67233b50cec026720d863e9d23238bc00

// 使用多种加密算法混合使用 这样的加密方式也可以提高数据的安全性
echo md5(sha1($password));//aad00ffb262d22f5f01904d7a3ad3f6c

非对称加密

非对称加密算法需要两个秘钥来进行加密和解密,这两个秘钥是公开密钥(public key,简称公钥)和私有秘钥(private key,简称私钥)

如上图所示,甲乙双方使用非对称加密算法完成了重要信息的安全传输

1.乙方生成一对密钥(公钥和私钥)并将公钥向甲方公开

2.得到该公钥的甲方使用该密钥对信息进行加密后再发给乙方

3.乙方再使用另一把密钥(私钥)对加密后的信息进行解密。乙方只能使用其专用的密钥(私钥)解密其对应公钥加密的信息

在传输过程中即便攻击者截获了传输的密文,并且获得了乙的公钥,也无法解开加密的信息,只能使用乙的密钥(私钥)才

能解密信息

在非对称加密中使用的算法主要有:

RSA、Elgamal、背包算法、Rabin、D-H、ECC(椭圆曲线加密算法)等。 其中我们最见的算法是RSA算法。其中最常

见的是 RSA

关于 PHP RSA算法后面会在写一篇相关的文章,先立一个flag。

 对称加密算法

对称加密是指加密和解密使用相同密钥的加密算法。有时又叫传统密码算法,就是加密密钥可以从解密密钥中推算出来,

同时解密密钥也可以从加密密钥中推算出来。而在大多数的对称算法中,加密密钥和解密密钥是相同的所以也会叫单密

钥算法。它要求发送方和接收方在安全通信之前,商定一个密钥。对称算法的安全性依赖于密钥,泄露密钥意味着任何人

都可以对他们发送或接收的消息解密,所以密钥的保密性对通信至关重要。

对称加密的常用算法有:DES算法、3DES算法、TEDA算法等。

 

在 PHP 中也有封装好的对称加密函数

urlencode/urldecode

urlencode/urldecode
string urlencode ( string $str ) 
/*
  1.$str 要加密的字符串(常用在对 url 的加密)
  2.该函数的原理是把中文字符转换成十六进制,然后每个字符前面加一个标识符%,对字符串中除了-(中划线)、_(下划线)、+(加号)之外的所有非字母数字字符都将被替换成百分号(%)后跟两位十六进制数,空格则编码为加号(+)
*/

urldecode 函数和 urlencode 函数原理相反,用于解码已编码的 url 字符串,其原理就是把十六进制字符串转换成中文字符

扩展:使用 urlencode 解决链接中带有 & 字符引起的问题

在前端传参到后台的时候如果我们想把 & 作为参数传到后台,在没有加密之前,浏览器会把它作为参数分隔符

比如:http://xiaoming.com?name=xiaoming&123&nickname=mingming,在这里我们想把 xiaoming&123 作为

参数传递给后台,但是如果直接通过$_POST 或 $_GET 方式获取的话得到的 name 值只有 xiaoming,而 123

被作为变量处理,为了解决这样的问题,我们就可以使用 urlencode 对这部分进行字符编码

<?php
$str = "http://xiaoming.com?name=".urlencode(xiaoming&123)."&nickname=mingming";

这样传过来的值就变成了 name = xiaoming&123

base64

base64 的几个应用场景:

1.加密url

thunder://QUFodHRwOi8vZGwxMTQuODBzLmltOjkyMC8xNzA0L1vmmI7mmJ/lpKfkvqbmjqJdMTDmoYjku7bov5jljp/vvJrnjovlmInlsJTigJzlsL/luorigJ3pga3mi4bnqb9oaW7lsLTlsKwvW+aYjuaYn+Wkp+S+puaOol0xMOahiOS7tui/mOWOn++8mueOi+WYieWwlOKAnOWwv+W6iuKAnemBreaLhuepv2hpbuWwtOWwrF9iZC5tcDRaWg==

这是一个迅雷下载链接,我们把这个链接前面的 thunder:// 去掉,使用 base64_decode 方法解密出来

<?php
echo base64_decode('QUFodHRwOi8vZGwxMTQuODBzLmltOjkyMC8xNzA0L1vmmI7mmJ/lpKfkvqbmjqJdMTDmoYjku7bov5jljp/vvJrnjovlmInlsJTigJzlsL/luorigJ3pga3mi4bnqb9oaW7lsLTlsKwvW+aYjuaYn+Wkp+S+puaOol0xMOahiOS7tui/mOWOn++8mueOi+WYieWwlOKAnOWwv+W6iuKAnemBreaLhuepv2hpbuWwtOWwrF9iZC5tcDRaWg==');

执行结果如下:

AAhttp://dl114.80s.im:920/1704/[明星大侦探]10案件还原:王嘉尔“尿床”遭拆穿hin尴尬/[明星大侦探]10案件还原:王嘉尔“尿床”遭拆穿hin尴尬_bd.mp4ZZ

可以看出,迅雷下载链接,在链接地址字符串前面加上 "AA" ,结尾加上 "ZZ",再进行 base64 加密。

2.传输二进制数据,比如图片等

这个应用场景就是PHP文档中提到的用途,下面看一个实例

<?php
echo base64_encode(file_get_contents('https://www.baidu.com/img/bd_logo1.png'));

执行结果如下:

iVBORw0KGgoAAAANSUhEUgAAAhwAAAECCAMAAACCFP44AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIi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QbF+QdGeQfG+QgHOUjH+UlIeUpJeUqJuYtKeYvK+YzL+c2Muc5Nec8OOg+OuhAPOlEQelGQ+lIRelKR+lMSepPTOtWU+tZVuteW+xiX+1mY+1qZ+1tau5wbu92dO99e/B/ffCAfvCCgPOZl/OenPjBwPjEw/jGxfnJyPnMy/nPzv3u7v3w8P719f729v75+f/7+//9/f///4DJalUAAAEAdFJOU////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wBT9wclAAAP2klEQVR42uzdaXwURRoGcKsrJEAIi0G5A4RATEICaBQWMYiEXcGA4Y6yHIICcikKAlkuJYRICCLHLklmhMUgghwiiAguiC6IcsgRORRRdzlFFLwRE377wWRm+qjq7pnumeme5/mYeaeH6frT3dNVXXUTQRBGbsIuQIADAQ4EOBDgQIADAQ4EOBDgQIADAQ4EAQ4EOBDgQIADAQ4EOBDgQIADAQ4EOBAEOBDgQIADAQ4EOBDgQIADAQ4EOBDgQBDgQIADAQ4EOBDgQIADAQ4EOBDgQIADAQ4EAQ4EOBDgQIADAQ4EOBDgQIADAQ4EOBAEOBDgQIADAQ4EOBDgQIADAQ4EOBDgQBDgQIADAQ4EOBDgQIADAQ4EOBDgQIADAQ4EAQ4EOBDgQIADAQ4EOBDgQIADAQ4EOBAEOBDgQIADAQ4EOBDgQIADAQ4EOBDgQBDgQIADAQ4EOHzP0uyH7klO6TSofiEIAIcohU+0oRVpN8UBBMDhTuz91COZ/4QC4KhMo1QqSscCHqTJjw0Zk1MEHKGRxq2oJGmLWLUNe/5R0XZ8VeAIgcSnUVkylI8MCYPdJe1mAof98xBVyGilyvx7RDVjncBh88xUskGT5skrZ7eWFA0uBg5bJ6yLIg4aJavMSZYVPeQADjunHmUkRvWylVI6CjjsnO4sHDXFdYs7KFY9Bxz2TSzLBk2p5lnn6Klc1S4BOGybp5k4aH3PultYVcOBw7Z5kI3jEY+yuBRWVVIccNg0V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wmtb2dPNlG26VGoGDhL3cKLauqBRw2tPz80viIubn5/3bN1RWX9tqWqj3bO6d8r+EtUc+XzNb0QbjqNfbzFiqJeZOCyR/EdSmCvQ9x8/S2EUUHHjyQPa8O5vjEwgIZGbQuA7hs98vPe9d3j0pXbOyBp5a4O5vDU/i3KjeyjfKEkbu4QQ4LBXwpYujYuLi0tY6tT6jmpzag+uITrspPZ7JsYRMnsshHB4GefiJjnT/l5nUt2pz86ND7HvDhwIcCDAgQAHAhwIcCDAgQAHAhwIcCDAgSDAgQAHAhwIcCDAgQAHAhwIcCDAgQAHggAHAhwIcCDAgfg1/x8Ate1CIJg9Qs4AAAAASUVORK5CYII=

对于图片的展示我们可以使用DataURI Scheme 方式,这个做移动端开发的应该比较了解

 

posted @ 2018-11-05 21:12  流光瞬息  阅读(7068)  评论(0编辑  收藏  举报