📄 sdes.h
字号:
// SDes.h: interface for the CSDes class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_SDES_H__90D4D52F_05BF_11D9_84D1_0040950837D8__INCLUDED_)
#define AFX_SDES_H__90D4D52F_05BF_11D9_84D1_0040950837D8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
typedef unsigned char byte;
typedef unsigned short word;
class CSDes
{
private:
byte *bytes;
long length;
word key;
byte key1,key2;
private:
bool GetBit (byte bt,byte pc);
bool GetBit (word bt,byte pc);
void SetBit (byte &bt,byte pc,bool dc);
void SetBit (word &bt,byte pc,bool dc);
void MoveL (byte &bt,byte len,byte ti);
void MoveR (byte &bt,byte len,byte ti);
void IP (byte &bt);
void IP_1 (byte &bt);
void FK (byte &bt,byte k);
void F (byte &bt,byte k);
void DesOne (byte &bt);
void UnDesOne(byte &bt);
void Swap4 (byte &bt);
void SwapAll (byte &bt,byte b7,byte b6,byte b5,byte b4,byte b3,byte b2,byte b1,byte b0);
void SwapAll (byte &bt,const byte *pc);
void SwapAll (word &bt,const byte *pc);
public:
CSDes();
CSDes(long len);
CSDes(char *p);
CSDes(CString p);
CSDes(byte *p,long len);
virtual ~CSDes();
public:
void SetBytes(byte *bt,long len);
void SetBytes(CString bt);
CString GetBitString();
CString GetString();
word GetKey();
public:
void SetKey(word new_key);
void SetKey(CString new_key);
void Des();
void UnDes();
byte *GetPByte() {return bytes;}
};
#endif // !defined(AFX_SDES_H__90D4D52F_05BF_11D9_84D1_0040950837D8__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -