www.pudn.com > CipherSystem.rar > RC4CipherSystem.h


#ifndef RC4_CIPHER_SYSTEM_H 
#define RC4_CIPHER_SYSTEM_H 
 
#include "MyCipherSystem.h" 
#include "GlobalFunctions.h" 
 
class RC4CipherSystem : public EncryptSystem 
{ 
public: 
 
	RC4CipherSystem(); 
	void GetData(const string& input); 
	void GetKey(int valueOfKarray[], int arrayLen); 
 
	void Encrypt(); 
	void Decrypt(); 
 
	friend void BinaryToChar(const string& binaryStr, string& charStr); 
	friend void CharToBinary(const string& charStr, string& binaryStr); 
 
private: 
 
	void SetKarray(int array[], int arrayLen); 
	void SetSarray(); 
	void KSA(); 
	Byte PSGA(); 
 
private: 
	int iS; 
	int jS; 
 
	string keyStream; 
 
	Byte K[256]; 
	Byte S[256]; 
}; 
 
 
#endif//RC4_CIPHER_SYSTEM_H