4slv/xxtea

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

Installs: 968

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 50

pkg:composer/4slv/xxtea

v1.0.7 2022-01-13 18:03 UTC

This package is not auto-updated.

Last update: 2025-10-04 09:16:18 UTC


README

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.

Usage

<?php
use xxtea\Xxtea;

$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!";
}
?>