Crypt_XXTEA
[ class tree: Crypt_XXTEA ] [ index: Crypt_XXTEA ] [ all elements ]

Class: Crypt_XXTEA

Source Location: /Crypt_XXTEA-0.9.0/Crypt/XXTEA.php

Class Overview


The main class


Author(s):

Version:

  • Release: 0.9.0

Copyright:

  • 2005-2008 Coolcode.CN

Methods


Inherited Variables

Inherited Methods


Class Details

[line 60]
The main class


[ Top ]


Method Detail

decrypt   [line 158]

mixed decrypt( mixed $chipertext)

Decrypts a cipher text
  • Return: the plain text as the same type as the parameter $chipertext on success, PEAR_Error on failure
  • Access: public

Parameters:

mixed   $chipertext   —  the cipher text (string or long integer array)

[ Top ]

encrypt   [line 131]

mixed encrypt( mixed $plaintext)

Encrypts a plain text

As the XXTEA encryption algorithm is designed for encrypting and decrypting the long integer array type of data, there is not a standard that defines how to convert between long integer array and text or binary data for it. So this package provides the ability to encrypt and decrypt the long integer arrays directly to satisfy the requirement for working with other implementations. And at the same time, for convenience, it also provides the ability to process strings, which uses its own method to group the text into array.

  • Return: the cipher text as the same type as the parameter $plaintext on success, PEAR_Error on failure
  • Access: public

Parameters:

mixed   $plaintext   —  the plain text (string or long integer array)

[ Top ]

setKey   [line 87]

bool setKey( mixed $key)

Sets the secret key

The key must be non-empty, and not more than 16 characters or 4 long values

  • Return: true on success, PEAR_Error on failure
  • Access: public

Parameters:

mixed   $key   —  the secret key (string or long integer array)

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:17:11 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.