class EE::System::RC4

Overview

RC4 Encryption Class. For more information check Wikipedia: http://en.wikipedia.org/wiki/RC4. More…

#include <rc4.hpp>

class RC4 {
public:
    // structs

    struct RC4Key;

    // construction

    ~RC4();

    // methods

    void setKey(const Uint8* key, Uint32 size);
    void setKey(const std::vector<Uint8>& Key);
    void setKey(const std::string& Key);
    void encryptByte(Uint8* data, Uint32 size);
    void encryptByte(std::vector<Uint8>& buffer);
    void decryptByte(std::vector<Uint8>& buffer);
    void encryptString(std::string& buffer);
    void decryptString(std::string& buffer);
    bool encryptFile(const std::string& SourceFile, const std::string& DestFile);
    bool decryptFile(const std::string& SourceFile, const std::string& DestFile);
};

Detailed Documentation

RC4 Encryption Class. For more information check Wikipedia: http://en.wikipedia.org/wiki/RC4.

Methods

void setKey(const Uint8* key, Uint32 size)

Set the encryption Key.

Parameters:

key

the key data

size

the key size

void setKey(const std::vector<Uint8>& Key)

Set the encryption Key.

void setKey(const std::string& Key)

Set the encryption Key.

void encryptByte(Uint8* data, Uint32 size)

Encrypt the buffer ( you must set the key first ).

Parameters:

data

The buffer to encrypt

size

The buffer size

void encryptByte(std::vector<Uint8>& buffer)

Encrypt a vector of bytes ( you must set the key first ).

void decryptByte(std::vector<Uint8>& buffer)

Decrypt a vector of bytes ( you must set the key first ).

void encryptString(std::string& buffer)

Encrypt a string ( you must set the key first ).

void decryptString(std::string& buffer)

Decrypt a string ( you must set the key first ).

bool encryptFile(const std::string& SourceFile, const std::string& DestFile)

Encrypt a file ( you must set the key first ).

bool decryptFile(const std::string& SourceFile, const std::string& DestFile)

Decrypt a file ( you must set the key first ).