37 #define KBase64 KCodecs
41 #include <tqiodevice.h>
42 #include "tdelibs_export.h"
87 static TQCString quotedPrintableEncode(
const TQByteArray & in,
102 static TQCString quotedPrintableEncode(
const TQCString & str,
103 bool useCRLF =
true);
123 static void quotedPrintableEncode(
const TQByteArray & in, TQByteArray& out,
134 static TQCString quotedPrintableDecode(
const TQByteArray & in);
145 static TQCString quotedPrintableDecode(
const TQCString & str);
164 static void quotedPrintableDecode(
const TQByteArray & in, TQByteArray& out);
178 static TQCString uuencode(
const TQByteArray& in );
189 static TQCString uuencode(
const TQCString& str );
206 static void uuencode(
const TQByteArray& in, TQByteArray& out );
218 static TQCString uudecode(
const TQByteArray& in );
229 static TQCString uudecode(
const TQCString& str );
250 static void uudecode(
const TQByteArray& in, TQByteArray& out );
266 static TQCString base64Encode(
const TQByteArray& in,
bool insertLFs =
false);
278 static TQCString base64Encode(
const TQCString& str,
bool insertLFs =
false );
301 static void base64Encode(
const TQByteArray& in, TQByteArray& out,
302 bool insertLFs =
false );
311 static TQCString base64Decode(
const TQByteArray& in );
322 static TQCString base64Decode(
const TQCString& str );
341 static void base64Decode(
const TQByteArray& in, TQByteArray& out );
348 static const char UUEncMap[64];
349 static const char UUDecMap[128];
350 static const char Base64EncMap[64];
351 static const char Base64DecMap[128];
352 static const char hexChars[16];
353 static const unsigned int maxQPLineLength;
406 typedef unsigned char Digest[16];
418 KMD5(
const char* in,
int len = -1);
425 KMD5(
const TQByteArray& a );
432 KMD5(
const TQCString& a );
442 void update(
const char* in,
int len = -1) {
update(
reinterpret_cast<const unsigned char*
>(in), len); }
447 void update(
const unsigned char* in,
int len = -1);
454 void update(
const TQByteArray& in );
461 void update(
const TQCString& in );
474 bool update(TQIODevice& file);
486 const Digest& rawDigest ();
497 void rawDigest( KMD5::Digest& bin );
503 TQCString hexDigest ();
508 void hexDigest(TQCString&);
514 TQCString base64Digest ();
520 bool verify(
const KMD5::Digest& digest);
525 bool verify(
const TQCString&);
532 void transform(
const unsigned char buffer[64] );
544 void encode(
unsigned char* output, TQ_UINT32 *in, TQ_UINT32 len );
545 void decode( TQ_UINT32 *output,
const unsigned char* in, TQ_UINT32 len );
547 TQ_UINT32 rotate_left( TQ_UINT32 x, TQ_UINT32 n );
548 TQ_UINT32 F( TQ_UINT32 x, TQ_UINT32 y, TQ_UINT32 z );
549 TQ_UINT32 G( TQ_UINT32 x, TQ_UINT32 y, TQ_UINT32 z );
550 TQ_UINT32 H( TQ_UINT32 x, TQ_UINT32 y, TQ_UINT32 z );
551 TQ_UINT32 I( TQ_UINT32 x, TQ_UINT32 y, TQ_UINT32 z );
552 void FF( TQ_UINT32& a, TQ_UINT32 b, TQ_UINT32 c, TQ_UINT32 d, TQ_UINT32 x,
553 TQ_UINT32 s, TQ_UINT32 ac );
554 void GG( TQ_UINT32& a, TQ_UINT32 b, TQ_UINT32 c, TQ_UINT32 d, TQ_UINT32 x,
555 TQ_UINT32 s, TQ_UINT32 ac );
556 void HH( TQ_UINT32& a, TQ_UINT32 b, TQ_UINT32 c, TQ_UINT32 d, TQ_UINT32 x,
557 TQ_UINT32 s, TQ_UINT32 ac );
558 void II( TQ_UINT32& a, TQ_UINT32 b, TQ_UINT32 c, TQ_UINT32 d, TQ_UINT32 x,
559 TQ_UINT32 s, TQ_UINT32 ac );
562 TQ_UINT32 m_state[4];
563 TQ_UINT32 m_count[2];
564 TQ_UINT8 m_buffer[64];
581 typedef unsigned char Digest[16];
593 KMD4(
const char* in,
int len = -1);
600 KMD4(
const TQByteArray& a );
607 KMD4(
const TQCString& a );
617 void update(
const char* in,
int len = -1) {
update(
reinterpret_cast<const unsigned char*
>(in), len); }
622 void update(
const unsigned char* in,
int len = -1);
629 void update(
const TQByteArray& in );
636 void update(
const TQCString& in );
649 bool update(TQIODevice& file);
661 const Digest& rawDigest ();
672 void rawDigest( KMD4::Digest& bin );
678 TQCString hexDigest ();
683 void hexDigest(TQCString&);
689 TQCString base64Digest ();
695 bool verify(
const KMD4::Digest& digest);
700 bool verify(
const TQCString&);
707 void transform( TQ_UINT32 buf[4], TQ_UINT32
const in[16] );
720 void byteReverse(
unsigned char *buf, TQ_UINT32 len );
722 TQ_UINT32 rotate_left( TQ_UINT32 x, TQ_UINT32 n );
723 TQ_UINT32 F( TQ_UINT32 x, TQ_UINT32 y, TQ_UINT32 z );
724 TQ_UINT32 G( TQ_UINT32 x, TQ_UINT32 y, TQ_UINT32 z );
725 TQ_UINT32 H( TQ_UINT32 x, TQ_UINT32 y, TQ_UINT32 z );
726 void FF( TQ_UINT32& a, TQ_UINT32 b, TQ_UINT32 c, TQ_UINT32 d, TQ_UINT32 x,
728 void GG( TQ_UINT32& a, TQ_UINT32 b, TQ_UINT32 c, TQ_UINT32 d, TQ_UINT32 x,
730 void HH( TQ_UINT32& a, TQ_UINT32 b, TQ_UINT32 c, TQ_UINT32 d, TQ_UINT32 x,
734 TQ_UINT32 m_state[4];
735 TQ_UINT32 m_count[2];
736 TQ_UINT8 m_buffer[64];
A wrapper class for the most commonly used encoding and decoding algorithms.
An adapted C++ implementation of the MD4 Message-Digest algorithm.
void update(const char *in, int len=-1)
Updates the message to be digested.
An adapted C++ implementation of RSA Data Securities MD5 algorithm.
void update(const char *in, int len=-1)
Updates the message to be digested.