Files
core/ASCOfficeXlsFile2/source/XlsFormat/Crypt/RC4Crypt.h
ElenaSubbotina 27c67d0aa4 DocFormatReader - анализ зашифрованности файла
XlsFormatReader - чтение зашифрованных файлов (введен параметр password на вход)
2016-05-21 01:37:43 +03:00

34 lines
780 B
C++

#pragma once
#include "Crypt.h"
#include <Logic/Biff_structures/RC4EncryptionHeader.h>
#include "BiffDecoder_RCF.h"
namespace CRYPT
{
class RC4Crypt : public Crypt
{
public:
RC4Crypt(CRYPTO::RC4EncryptionHeaderPtr & header, std::wstring password);
virtual void Encrypt(char* data, const size_t size);
virtual void Decrypt(char* data, const size_t size, const unsigned long stream_pos);
virtual bool IsVerify();
private:
void CopyDWORDs2Bytes(const unsigned int b1, const unsigned int b2, const unsigned int b3, const unsigned int b4, unsigned char* byte_array);
unsigned char pnSalt[16];
unsigned char pnVerifier[16];
unsigned char pnVerifierHash[16];
BiffDecoderRef mxDecoder;
bool m_VerifyPassword;
};
} // namespace CRYPT