diff options
author | Rosemary <rosemaryseb8@gmail.com> | 2015-10-04 07:58:21 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-10-08 17:45:52 +0200 |
commit | c597581852cf1d3550359dc639f1bb7f6476f419 (patch) | |
tree | ddccc9ffa1ef3057cbb276374bea2192b43ae543 /include/oox | |
parent | 56a36956ed1fee1dd53817a81bcb2241373aebdc (diff) |
Implement encryption for the VBA export
Change-Id: Id994095de9f43cf0c2857272b613abe7cbd9324e
Diffstat (limited to 'include/oox')
-rw-r--r-- | include/oox/ole/vbaexport.hxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/oox/ole/vbaexport.hxx b/include/oox/ole/vbaexport.hxx index 7b5b91660044..2c03cc274e11 100644 --- a/include/oox/ole/vbaexport.hxx +++ b/include/oox/ole/vbaexport.hxx @@ -111,6 +111,38 @@ private: SvMemoryStream& mrUncompressedStream; }; +class VBAEncryption +{ +public: + VBAEncryption(const sal_uInt8* pData, + const sal_uInt16 nLength, + SvStream& rEncryptedData + ); + + void write(); + +private: + const sal_uInt8* mpData; // an array of bytes to be obfuscated + const sal_uInt16 mnLength; // the length of Data + SvStream& mrEncryptedData; // Encrypted Data Structure + sal_uInt8 mnUnencryptedByte1; // the last unencrypted byte read or written + sal_uInt8 mnEncryptedByte1; // the last encrypted byte read or written + sal_uInt8 mnEncryptedByte2; // the next-to-last encrypted byte read or written + sal_uInt8 mnVersion; // the encrypted version + sal_Unicode mnProjKey; // a project-specific encryption key + sal_uInt8 mnIgnoredLength; // the length in bytes of IgnoredEnc + + sal_uInt8 mnSeed; // the seed value + sal_uInt8 mnVersionEnc; // the version encoding + + void writeSeed(); + void writeVersionEnc(); + void writeProjKeyEnc(); + void writeIgnoredEnc(); + void writeDataLengthEnc(); + void writeDataEnc(); +}; + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |