This website does readability filtering of other pages. All styles, scripts, forms and ads are stripped. If you want your website excluded or have other feedback, use this form.

GitHub - xxtea/xxtea-php: XXTEA encryption algorithm library for PHP.

Skip to content

Sign in or Sign up

xxtea/xxtea-php

Join GitHub today

GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.

Sign up XXTEA encryption algorithm library for PHP.
  1. PHP 100.0%
PHP Switch branches/tags master Nothing to show v1.0.2 v1.0.1 v1.0.0 Nothing to show Find file Clone or download

Clone with HTTPS

Use Git or checkout with SVN using the web URL.

Download ZIP

Launching GitHub Desktop...

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop...

If nothing happens, download GitHub Desktop and try again.

Launching Xcode...

If nothing happens, download Xcode and try again.

Launching Visual Studio...

If nothing happens, download the GitHub extension for Visual Studio and try again.

andot Fixed mx on windows x64. Latest commit 3906dd2 Mar 2, 2016 Permalink Failed to load latest commit information. tests Update unittest Feb 13, 2016 .gitignore Update unittest Feb 13, 2016 .travis.yml Removed unittest for PHP 5.2 Feb 13, 2016 LICENSE.md Update LICENSE.md Feb 6, 2016 README.md Update README Feb 13, 2016 README_zh_CN.md Update README Feb 13, 2016 composer.json Update unittest Feb 13, 2016 xxtea.php Fixed mx on windows x64. Mar 2, 2016

README.md

XXTEA for PHP

Introduction

XXTEA is a fast and secure encryption algorithm. This is a XXTEA library for PHP.

It is different from the original XXTEA encryption algorithm. It encrypts and decrypts string instead of uint32 array, and the key is also string.

Installation

Download the xxtea.php, and put it in your develepment directory.

Usage

<?php
    require_once("xxtea.php");
    $str = "Hello World! 你好,中国!";
    $key = "1234567890";
    $encrypt_data = xxtea_encrypt($str, $key);
    $decrypt_data = xxtea_decrypt($encrypt_data, $key);
    if ($str == $decrypt_data) {
        echo "success!";
    } else {
        echo "fail!";
    }
?>
You can’t perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. Press h to open a hovercard with more details.