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

📄 encoderopensslimpl.h

📁 这是一个基于VS2003开发的数据加密和解密的程序
💻 H
字号:
/*!
	\file EncoderOpenSslImpl.h
	\author Jackson
	\date 13/1/2005
*/

#ifndef _LUCID_ENCRYPTION_ENCODEROPENSSLIMPL_H_
#define _LUCID_ENCRYPTION_ENCODEROPENSSLIMPL_H_

#include "ShareLib.h"

#include "EncoderImplBase.h"
#include "openssl/evp.h"

//#include "Lucid/System/Thread/Thread.h"

namespace Lucid {

namespace Encryption {

//! \class TEncoderOpenSslImpl
/*!
	\brief Encoder implementation using OpenSSL
*/
class TEncoderOpenSslImpl : public TEncoderImplBase {
public:
	//! Constructor
	/*!
		\param key key for encryption
		\param key_length length of key
		\param iv initial vector encryption
		\param iv_length length of initial vector
		\param algorithm encode algorithm used
	*/
	TEncoderOpenSslImpl(const unsigned char* key, unsigned int key_length, const unsigned char* iv = 0, unsigned int iv_length = 0, TEncodeAlgorithm algorithm = NO_ENCODE);

	//! Destructor
	/*!
	*/
	virtual ~TEncoderOpenSslImpl();

	/*!
		\brief encode input byte array
		\param input input byte array
		\param output output byte array
		\param input_len length of input array
		\param output_len length of output array
	*/
	virtual void Encode(const unsigned char* input, unsigned char* output, const int input_len, int& output_len);

	/*!
		\brief decode input byte array
		\param input input byte array
		\param output output byte array
		\param input_len length of input array
		\param output_len length of output array
	*/
	virtual void Decode(const unsigned char* input, unsigned char* output, const int input_len, int& output_len);

private:
	const EVP_CIPHER* GetAlgorithmType() const;
	EVP_CIPHER_CTX mEncodeCtx;
	EVP_CIPHER_CTX mDecodeCtx;

//	Lucid::System::Thread::TThreadMutex mMutex;
};

}

}

#endif	// _LUCID_ENCRYPTION_ENCODEROPENSSLIMPL_H_

⌨️ 快捷键说明

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