TTKMusicPlayer  3.7.0.0
TTKMusicPlayer imitates Kugou UI, the music player uses of qmmp core library based on Qt for windows and linux
Public Member Functions | Private Member Functions | List of all members
TTKCryptographicHash Class Reference

The class of the string cryptographic hash. More...

#include <ttkcryptographichash.h>

Public Member Functions

 TTKCryptographicHash ()
 
QString encrypt (const QString &data, const QString &key)
 
QString decrypt (const QString &data, const QString &key)
 

Private Member Functions

TTKString xxteaEncrypt (const TTKString &data, const TTKString &key)
 
QString xxteaEncrypt (const QString &data, const QString &key)
 
TTKString xxteaDecrypt (const TTKString &data, const TTKString &key)
 
QString xxteaDecrypt (const QString &data, const QString &key)
 
uchar * doXxteaEncrypt (uchar *data, xxtea_uint len, uchar *key, xxtea_uint *retLength)
 
uchar * doXxteaDecrypt (uchar *data, xxtea_uint len, uchar *key, xxtea_uint *retLength)
 
void xxteaUintEncrypt (xxtea_uint *v, xxtea_uint len, xxtea_uint *k)
 
void xxteaUintDecrypt (xxtea_uint *v, xxtea_uint len, xxtea_uint *k)
 
uchar * fixKeyLength (uchar *key, xxtea_uint keyLength)
 
xxtea_uintxxteaToUintArray (uchar *data, xxtea_uint len, int includeLength, xxtea_uint *retLength)
 
uchar * xxteaToByteArray (xxtea_uint *data, xxtea_uint len, int includeLength, xxtea_uint *retLength)
 
uchar * xxteaEncrypt (uchar *data, xxtea_uint dataLength, uchar *key, xxtea_uint keyLength, xxtea_uint *retLengthgth)
 
uchar * xxteaDecrypt (uchar *data, xxtea_uint dataLength, uchar *key, xxtea_uint keyLength, xxtea_uint *retLengthgth)
 

Detailed Description

The class of the string cryptographic hash.

Author
Greedysky greed.nosp@m.ysky.nosp@m.@163..nosp@m.com

Definition at line 39 of file ttkcryptographichash.h.

Constructor & Destructor Documentation

TTKCryptographicHash::TTKCryptographicHash ( )

Object constructor.

Definition at line 136 of file ttkcryptographichash.cpp.

Member Function Documentation

QString TTKCryptographicHash::decrypt ( const QString &  data,
const QString &  key 
)

decrypt by QString data.

Definition at line 146 of file ttkcryptographichash.cpp.

References xxteaDecrypt().

Referenced by TTK::Algorithm::mdII().

uchar * TTKCryptographicHash::doXxteaDecrypt ( uchar *  data,
xxtea_uint  len,
uchar *  key,
xxtea_uint retLength 
)
private

Do XXTEA decrypt.

Definition at line 336 of file ttkcryptographichash.cpp.

References free(), xxteaToByteArray(), xxteaToUintArray(), and xxteaUintDecrypt().

Referenced by xxteaDecrypt().

uchar * TTKCryptographicHash::doXxteaEncrypt ( uchar *  data,
xxtea_uint  len,
uchar *  key,
xxtea_uint retLength 
)
private

Do XXTEA encrypt.

Definition at line 319 of file ttkcryptographichash.cpp.

References free(), xxteaToByteArray(), xxteaToUintArray(), and xxteaUintEncrypt().

Referenced by xxteaEncrypt().

QString TTKCryptographicHash::encrypt ( const QString &  data,
const QString &  key 
)

encrypt by QString data.

Definition at line 141 of file ttkcryptographichash.cpp.

References xxteaEncrypt().

Referenced by TTK::Algorithm::mdII(), xxteaDecrypt(), and xxteaEncrypt().

uchar * TTKCryptographicHash::fixKeyLength ( uchar *  key,
xxtea_uint  keyLength 
)
private

Fix key length.

Definition at line 256 of file ttkcryptographichash.cpp.

References malloc().

Referenced by xxteaDecrypt(), and xxteaEncrypt().

TTKString TTKCryptographicHash::xxteaDecrypt ( const TTKString data,
const TTKString key 
)
private

XXTEA decrypt by TTKString data.

Definition at line 169 of file ttkcryptographichash.cpp.

References TTK::base64Decode(), encrypt(), and free().

Referenced by decrypt(), and xxteaDecrypt().

QString TTKCryptographicHash::xxteaDecrypt ( const QString &  data,
const QString &  key 
)
private

XXTEA decrypt by QString data.

Definition at line 203 of file ttkcryptographichash.cpp.

References xxteaDecrypt().

uchar * TTKCryptographicHash::xxteaDecrypt ( uchar *  data,
xxtea_uint  dataLength,
uchar *  key,
xxtea_uint  keyLength,
xxtea_uint retLengthgth 
)
private

XXTEA decrypt by uchar * data.

Definition at line 372 of file ttkcryptographichash.cpp.

References doXxteaDecrypt(), fixKeyLength(), and free().

TTKString TTKCryptographicHash::xxteaEncrypt ( const TTKString data,
const TTKString key 
)
private

XXTEA encrypt by TTKString data.

Definition at line 151 of file ttkcryptographichash.cpp.

References TTK::base64Encode(), encrypt(), and free().

Referenced by encrypt(), and xxteaEncrypt().

QString TTKCryptographicHash::xxteaEncrypt ( const QString &  data,
const QString &  key 
)
private

XXTEA encrypt by QString data.

Definition at line 198 of file ttkcryptographichash.cpp.

References xxteaEncrypt().

uchar * TTKCryptographicHash::xxteaEncrypt ( uchar *  data,
xxtea_uint  dataLength,
uchar *  key,
xxtea_uint  keyLength,
xxtea_uint retLengthgth 
)
private

XXTEA encrypt by uchar * data.

Definition at line 353 of file ttkcryptographichash.cpp.

References doXxteaEncrypt(), fixKeyLength(), and free().

uchar * TTKCryptographicHash::xxteaToByteArray ( xxtea_uint data,
xxtea_uint  len,
int  includeLength,
xxtea_uint retLength 
)
private

XXTEA to byte array.

Definition at line 291 of file ttkcryptographichash.cpp.

References malloc().

Referenced by doXxteaDecrypt(), and doXxteaEncrypt().

xxtea_uint * TTKCryptographicHash::xxteaToUintArray ( uchar *  data,
xxtea_uint  len,
int  includeLength,
xxtea_uint retLength 
)
private

XXTEA to uint array.

Definition at line 264 of file ttkcryptographichash.cpp.

References malloc().

Referenced by doXxteaDecrypt(), and doXxteaEncrypt().

void TTKCryptographicHash::xxteaUintDecrypt ( xxtea_uint v,
xxtea_uint  len,
xxtea_uint k 
)
private

XXTEA uint decrypt.

Definition at line 232 of file ttkcryptographichash.cpp.

References XXTEA_DELTA, and XXTEA_MX.

Referenced by doXxteaDecrypt().

void TTKCryptographicHash::xxteaUintEncrypt ( xxtea_uint v,
xxtea_uint  len,
xxtea_uint k 
)
private

XXTEA uint encrypt.

Definition at line 208 of file ttkcryptographichash.cpp.

References XXTEA_DELTA, and XXTEA_MX.

Referenced by doXxteaEncrypt().


The documentation for this class was generated from the following files: