00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #pragma once
00032 #include "stdafx.h"
00033
00034 #include <iostream>
00035 #include <math.h>
00036 #include <string>
00037 #include "Global.h"
00038 #include "KryptosTimer.h"
00039
00040 #include "AlgorithmSheet.h"
00041 #include "CryptoLink.h"
00042
00043 using namespace std;
00044
00049 class COpenSSLLink : public CCryptoLink
00050 {
00051 public:
00052 COpenSSLLink();
00053 COpenSSLLink(CWnd* pParent,CAlgorithmSheet* options);
00054
00055 virtual ~COpenSSLLink(void);
00056
00057 DECLARE_DYNCREATE(COpenSSLLink);
00058
00059 virtual void ProcessMACVer();
00060 virtual void ProcessMACGen();
00061 virtual void ProcessHash();
00062 virtual void ProcessHashVerify();
00063 virtual bool processVerify();
00064 virtual void processSign();
00065 virtual void processPK();
00066 virtual BOOL processRequest(DWORD numPumps,DWORD sizePumps,DWORD m_lastPump);
00067 virtual string ByteToHexString(byte *out, int bytesize);
00068 virtual byte *GetIV( int bytesize);
00069
00070 private:
00071 bool ProcessDES();
00072 bool ProcessDESX();
00073 bool ProcessBF();
00074 bool ProcessDES_EDE2();
00075 bool ProcessDES_EDE3();
00076 bool Process3DES();
00077 bool ProcessIDEA();
00078 bool ProcessAES();
00079
00080 void setParameterKey();
00081 void setParameterIV();
00082
00083 unsigned int ReadBlock(ifstream *inFile, byte *inBlock, unsigned int blockSize);
00084
00086 CAlgorithmSheet* p_AlgorithmSheet;
00088 CWnd* m_pParent;
00090 BYTE *m_iv;
00092 BYTE *m_key;
00093 int m_operator,m_operation;
00094 BOOL m_success;
00096 DWORD m_numPumps,m_sizePumps,m_lastPump;
00098 int m_symCipAlg;
00100 int m_symCipKeySizeByte;
00102 int m_symCipBlockSizeByte;
00104 int m_rounds;
00106 int m_mode;
00108 int m_feedbackByte;
00109
00111 CString pathInFile;
00113 CString pathOutFile;
00114
00115 void HashFileToFile(const char *infilename, const char *outfilename, string hash);
00116 string HashFileToString(const char *filename, string hash);
00117 };