⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xtunnelscvsdes.h

📁 xtunnel nat/fw traversal source code
💻 H
字号:
/*	File:		XTunnelsCVsDES.h	Contains:   DES routines 	Copyright:  (c) 2003 by Xten Networks, Inc., all rights reserved.*/#ifndef CVSDES_H__29AB99C3_80C0_475e_80BB_19AC81E50D44_#define CVSDES_H__29AB99C3_80C0_475e_80BB_19AC81E50D44_#ifdef __MWERKS__#pragma once#endif // __MWERKS__#include <iostream>#include <strstream>struct STDESPrivateData;class CVsDES{public:   enum DESMode   {      DES = 1,      DES2 = 2,      TripleDES = 3   };   enum DESLength   {      SingleLength = 1,      DoubleLength = 2,      TripleLength = 3   };public:   CVsDES()          {Init();}   virtual ~CVsDES() {Destroy();}   unsigned long GetBlockSize()  {return sizeof(unsigned long);}   void OpenRead(                         // for decrypting      const char * szKey,      std::istrstream *ipInputStream,      DESMode eMode = TripleDES,          // default maximum encryption      DESLength eLength = TripleLength    // default maximum length blocks   );   void OpenWrite(                        // for encrypting      const char * szKey,      std::ostrstream *ipOuputStream,      DESMode eMode = TripleDES,      DESLength eLength = TripleLength    // default maximum length blocks   );   virtual bool Read(       char  *pbyBuffer,      unsigned long  dwBytesToRead,      unsigned long *pBytesRead = NULL   );   virtual bool Write(      const char *pBuffer,      unsigned long dwBufferLength,      unsigned long *pBytesWritten = NULL   );   // WARNING: The last write before a close will be padded with zeros and aligned to the   // nearest 8, 16 or 32 bits depending on the encryption scheme choosen (SingleLength,   // DoubleLength, TripleLength). These zeros will be part of the output stream, and   // nothing can be done about it. When you read back the decrypted stream, you will see   // these padded zeros at the end of the stream read block.   virtual void Close(unsigned long *pBytesWritten = NULL);private:   void Init();   void Destroy();private:   STDESPrivateData *m_pData;	std::istrstream *m_iStream;	std::ostrstream *m_oStream;   bool m_bReadMode;};#endif //CVSDES_H__29AB99C3_80C0_475e_80BB_19AC81E50D44_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -