TTKMusicPlayer  4.1.3.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

QString encrypt (const QString &data, const char *key)
 
QString decrypt (const QString &data, const char *key)
 

Private Member Functions

TTKString xxteaEncrypt (const TTKString &data, const char *key)
 
TTKString xxteaDecrypt (const TTKString &data, const char *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.

Member Function Documentation

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

decrypt by QString data.

Definition at line 142 of file ttkcryptographichash.cpp.

References TTK::base64Decode(), and 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 322 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 305 of file ttkcryptographichash.cpp.

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

Referenced by xxteaEncrypt().

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

encrypt by QString data.

Definition at line 136 of file ttkcryptographichash.cpp.

References TTK::base64Encode(), key, and xxteaEncrypt().

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

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

Fix key length.

Definition at line 242 of file ttkcryptographichash.cpp.

References malloc().

Referenced by xxteaDecrypt(), and xxteaEncrypt().

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

XXTEA decrypt by TTKString data.

Definition at line 163 of file ttkcryptographichash.cpp.

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

Referenced by decrypt().

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 358 of file ttkcryptographichash.cpp.

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

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

XXTEA encrypt by TTKString data.

Definition at line 147 of file ttkcryptographichash.cpp.

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

Referenced by encrypt().

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 339 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 277 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 250 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 217 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 192 of file ttkcryptographichash.cpp.

References XXTEA_DELTA, and XXTEA_MX.

Referenced by doXxteaEncrypt().


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