Giter Club home page Giter Club logo

encrypt's Introduction

Encrypt

演示地址又回来了

理论上可以加密 位图大小的 1/4,实际上会小一点

增加了 PNG 图片的支持, PNG 图片加密无限制大小

Encrypt 说明

<?php
   require 'Encrypt.php';

   $encrypt = new Encrypt();
   // 加密文件 ===> 解密的时候注释掉下面两行  参数三是生成新文件, (如果不填则返回加密后的数据二进制流)
   $encrypt->encryptFile('data/data.txt', 'data/bg.bmp', 'gps.bmp') or die($encrypt->getErrorMsg());
   exit('加密成功');

   // 解密文件  参数一是需要解密的文件, 参数二是路径,不要写文件名,因为会自动保留文件名(如果不填则返回加密后的数据二进制流)
   $encrypt->decryptFile('gps.bmp', './') or die($encrypt->getErrorMsg());
   exit('解密成功');

加密说明

1.在根目录新建一个 index.php 1.把 上面的代码 复制到 index.php, 运行 index.php
2.在 index.php 同级目录将会多出一个 gps.bmp ( encryptFile() 参数三是新文件名 ) 文件
3.新生成的 gps.bmp 就是已经将加密内容加密进去的加密位图


解密说明

1.注释掉加密文件的两行代码, 运行 index.php
2.在 index.php 同级目录将会多出一个文件, 就是之前的加密文件, 保留文件名, 格式, 大小, 数据

encrypt's People

Contributors

seth-shi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.