ultimatepp/bazaar/StreamCypher/RC4.h
micio b23908dff1 Bazaar/StreamCypher : added a couple of class for stream data encoding/decoding
git-svn-id: svn://ultimatepp.org/upp/trunk@2726 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2010-09-29 17:40:12 +00:00

31 lines
479 B
C++

#ifndef _TestProtec_RC4_h_
#define _TestProtec_RC4_h_
#include <Core/Core.h>
NAMESPACE_UPP
class RC4
{
private:
byte sbox[256];
byte si, sj;
public:
RC4();
RC4(String const &key);
RC4(byte const *keyBuf, int keyLen);
bool SetKey(String const &key);
bool SetKey(byte const *keyBuf, int keyLen);
void Encode(const byte *src, byte *dst, size_t len);
void Encode(byte *buf, size_t len);
String Encode(String const &s);
};
END_UPP_NAMESPACE
#endif