mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 02:44:13 +08:00
34 lines
780 B
C++
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
|