2017 © Pedro Peláez
 

library aes

PHP AES encryption

image

lyhiving/aes

PHP AES encryption

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

AES encryption

php aes加解密简单应用。, (*1)

PHP与JS通信对称加解密通道

可见的问题,一旦JS端泄露密钥,这个加解密的就不是那么好玩了。不过作为一个不错的加密通信方式,比明文要强一点。速度也是杠杠的。, (*2)

安装

使用 Composer, (*3)

{
    "require": {
            "lyhiving/aes": "1.0.*"
    }
}

用法

<?php
use lyhiving\aes\aes;

$key = 'aKingoftheWorld';
$iv = '76abd3e3a42b41df';
$txt = '我是一段加密的话,ABCD1234。';
$aes = new aes($key, $iv, 'aes-128-cbc');

加密:, (*4)

<?php

$txt_en = $aes->encode($txt);

解密:, (*5)

<?php

$txt_de = $aes->decode($txt_en);

重点:$iv 要求必须是16位的。

所以,自己生成一个16位字符会更好点。, (*6)

比如: 生成一个16位的MD5, (*7)

The Versions

19/07 2018

dev-master

9999999-dev https://github.com/lyhiving/aes

PHP AES encryption

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-gd *

 

encryption aes

19/07 2018

1.0.0

1.0.0.0 https://github.com/lyhiving/aes

PHP AES encryption

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-gd *

 

encryption aes