20#ifndef INCLUDED_FILTER_MSFILTER_MSCODEC_HXX
21#define INCLUDED_FILTER_MSFILTER_MSCODEC_HXX
23#include <com/sun/star/uno/Sequence.hxx>
25#include <rtl/cipher.h>
26#include <rtl/digest.h>
32 namespace beans {
struct NamedValue; }
52 void InitKey(
const sal_uInt8 pnPassData[ 16 ] );
60 bool InitCodec(
const css::uno::Sequence< css::beans::NamedValue >&
aData );
68 css::uno::Sequence< css::beans::NamedValue > GetEncryptionData();
85 bool VerifyKey( sal_uInt16 nKey, sal_uInt16 nHash )
const;
122 void Skip( std::size_t nBytes );
155 virtual void Decode(
sal_uInt8* pnData, std::size_t nBytes )
override;
176 virtual void Decode(
sal_uInt8* pnData, std::size_t nBytes )
override;
182 MSCodec97(
size_t nHashLen, OUString aEncKeyName);
191 bool InitCodec(
const css::uno::Sequence< css::beans::NamedValue >&
aData);
199 virtual css::uno::Sequence<css::beans::NamedValue> GetEncryptionData();
209 virtual void InitKey(
const sal_uInt16 pPassData[16],
270 bool Encode(
const void* pData, std::size_t nDatLen,
271 sal_uInt8* pBuffer, std::size_t nBufLen);
295 bool Decode(
const void* pData, std::size_t nDatLen,
296 sal_uInt8* pBuffer, std::size_t nBufLen);
310 bool Skip(std::size_t nDatLen);
348 virtual void InitKey(
const sal_uInt16 pPassData[16],
366 virtual bool InitCipher(sal_uInt32 nCounter)
override;
369 void CreateSaltDigest(
390 virtual void GetDigestFromSalt(
const sal_uInt8* pSaltData,
sal_uInt8* pDigest)
override;
406 virtual void InitKey(
const sal_uInt16 pPassData[16],
408 virtual bool InitCipher(sal_uInt32 nCounter)
override;
409 virtual void GetDigestFromSalt(
const sal_uInt8* pSaltData,
sal_uInt8* pDigest)
override;
410 virtual css::uno::Sequence<css::beans::NamedValue> GetEncryptionData()
override;
std::vector< sal_uInt8 > m_aDigestValue
MSCodec97 & operator=(const MSCodec97 &)=delete
virtual bool InitCipher(sal_uInt32 nCounter)=0
Rekeys the codec using the specified counter.
virtual void InitKey(const sal_uInt16 pPassData[16], const sal_uInt8 pDocId[16])=0
Initializes the algorithm with the specified password and document ID.
virtual void GetDigestFromSalt(const sal_uInt8 *pSaltData, sal_uInt8 *pDigest)=0
MSCodec97(const MSCodec97 &)=delete
std::vector< sal_uInt8 > m_aDocId
css::uno::Sequence< sal_Int8 > m_aStd97Key
Encodes and decodes data from protected MSO 97+ documents.
MSCodec_Std97(const MSCodec_Std97 &)=delete
MSCodec_Std97 & operator=(const MSCodec_Std97 &)=delete
Encodes and decodes data from protected MSO 95- documents.
std::size_t mnOffset
Encryption key.
MSCodec_Xor95(const MSCodec_Xor95 &)=delete
Key offset.
MSCodec_Xor95 & operator=(const MSCodec_Xor95 &)=delete
virtual void Decode(sal_uInt8 *pnData, std::size_t nBytes)=0
Decodes a block of memory inplace.
int mnRotateDistance
Hash value from password.
sal_uInt16 mnHash
Base key from password.
Encodes and decodes data from protected MSO Word 95- documents.
Encodes and decodes data from protected MSO XLS 95- documents.
#define MSFILTER_DLLPUBLIC
constexpr OUStringLiteral aData
Shape IDs per cluster in DGG atom.
const sal_uInt32 SHA256_HASH_LENGTH
const sal_uInt32 SHA1_HASH_LENGTH
const sal_uInt32 ENCRYPT_ALGO_AES192
const sal_uInt32 VERSION_INFO_1997_FORMAT
const sal_uInt32 ENCRYPT_ALGO_AES256
const sal_uInt32 ENCRYPT_PROVIDER_TYPE_AES
const sal_uInt32 VERSION_INFO_2007_FORMAT
const sal_uInt32 ENCRYPT_KEY_SIZE_AES_128
const sal_uInt32 VERSION_INFO_2007_FORMAT_SP2
const sal_uInt32 ENCRYPT_ALGO_AES128
const sal_uInt32 ENCRYPT_HASH_SHA1
const sal_uInt32 AGILE_ENCRYPTION_RESERVED
const sal_uInt32 ENCRYPT_KEY_SIZE_AES_256
const sal_uInt32 ENCRYPTINFO_AES
const sal_uInt32 ENCRYPT_PROVIDER_TYPE_RC4
const sal_uInt32 ENCRYPTED_VERIFIER_LENGTH
const sal_uInt32 VERSION_INFO_AGILE
const sal_uInt32 ENCRYPTINFO_DOCPROPS
const sal_uInt32 SALT_LENGTH
const sal_uInt32 ENCRYPT_KEY_SIZE_AES_192
const sal_uInt32 ENCRYPTINFO_CRYPTOAPI
const sal_uInt32 ENCRYPT_ALGO_RC4
const sal_uInt32 ENCRYPTINFO_EXTERNAL
sal_uInt32 encryptedVerifierHashSize
sal_uInt32 encryptedVerifierHashSize
EncryptionStandardHeader header
EncryptionVerifierRC4 verifier
EncryptionVerifierAES verifier
EncryptionStandardHeader header