Giter Club home page Giter Club logo

phpaes's Introduction

php-aes

javaAes2php

目前和和其他公司项目接口对接,对方项目是java开发,丢过来的接口文档上面有个字段说明是aes加密了,其他的信息没了, 经过几次沟通,叫对方给了一个明文和密文的东西给过来,然后才知道对方是用什么模式生成的。

php > 5.5

How to install? To use this extension, you may insert the following code:

Get it via composer by adding the package to your composer.json:

{
  "require": {
    "crazyfd/phpaes": "dev-master"
  }
}

执行命令

php composer.phar update

使用

<?php 
$key = '1111111122222222';
$content = 'php';
$content2 = 'SqdeMqCpaO8qfXP+Z2ICoQ==';

$aes = new \carazyfd\phpaes\Aes($key);
$content =$aes->strPad($content, 16);
echo $aes->encode($content);
echo "<br>";
echo $aes->decode($content2);

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.