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 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%
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.

Fetching latest commit… Cannot retrieve the latest commit at this time. Permalink TypeNameLatest commit messageCommit time Failed to load latest commit information. tests .gitignore .travis.yml LICENSE.md Update LICENSE.md Feb 6, 2016 README.md README_zh_CN.md composer.json xxtea.php

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.