huangyu_945 发表于 2012-12-11 11:06

php 用base64对图片加密

php 用base64对图片加密如何对其解密呢?

加密代码如下:<html>
<head>
        <title>TesT</title>
        </head>
<body>       
<?php
$file = "./image/index.png";
$type = getimagesize($file);
$fp = fopen($file,"r") or die("Can't open file");
$file_content = chunk_split(base64_encode(fread($fp,filesize($file))));
switch($type){
                case 1:$img_type="gif";break;
                case 2:$img_type="jpg";break;
                case 3:$img_type="png";break;
        }
$img = 'data:image/'.$img_type.';base64,'.$file_content;
fclose($fp);
?>
<img id="img" src="<?php echo $img; ?>" />
</body>
</html>

linux_c_py_php 发表于 2012-12-11 16:29

decode就不会了吗.

maochanglu 发表于 2012-12-17 10:24

aes 之流才算加密。。

huangyu_945 发表于 2012-12-20 13:43

回复 2# linux_c_py_php
怎么用?



   
页: [1]
查看完整版本: php 用base64对图片加密