#include <mscodec.hxx>
Public Member Functions | |
| MSCodec_Std97 () | |
| ~MSCodec_Std97 () | |
| void | InitKey (const sal_uInt16 pPassData[16], const sal_uInt8 pUnique[16]) |
| Initializes the algorithm with the specified password and document ID. | |
| bool | VerifyKey (const sal_uInt8 pSaltData[16], const sal_uInt8 pSaltDigest[16]) |
| Verifies the validity of the password using the passed salt data. | |
| bool | InitCipher (sal_uInt32 nCounter) |
| Rekeys the codec using the specified counter. | |
| bool | Decode (const void *pData, sal_Size nDatLen, sal_uInt8 *pBuffer, sal_Size nBufLen) |
| Decodes a block of memory. | |
| bool | Skip (sal_Size nDatLen) |
| Lets the cipher skip a specific amount of bytes. | |
Private Member Functions | |
| SVX_DLLPRIVATE | MSCodec_Std97 (const MSCodec_Std97 &) |
| SVX_DLLPRIVATE MSCodec_Std97 & | operator= (const MSCodec_Std97 &) |
Private Attributes | |
| rtlCipher | m_hCipher |
| rtlDigest | m_hDigest |
| sal_uInt8 | m_pDigestValue [RTL_DIGEST_LENGTH_MD5] |
This is a wrapper class around low level cryptographic functions from RTL. Implementation is based on the wvDecrypt package by Caolan McNamara: http://www.csn.ul.ie/~caolan/docs/wvDecrypt.html
Definition at line 185 of file mscodec.hxx.
| svx::MSCodec_Std97::MSCodec_Std97 | ( | ) | [explicit] |
| svx::MSCodec_Std97::~MSCodec_Std97 | ( | ) |
| SVX_DLLPRIVATE svx::MSCodec_Std97::MSCodec_Std97 | ( | const MSCodec_Std97 & | ) | [private] |
| void svx::MSCodec_Std97::InitKey | ( | const sal_uInt16 | pPassData[16], | |
| const sal_uInt8 | pUnique[16] | |||
| ) |
Initializes the algorithm with the specified password and document ID.
| pPassData | Wide character array containing the password. Must be zero terminated, which results in a maximum length of 15 characters. | |
| pUnique | Unique document identifier read from or written to the file. |
Definition at line 244 of file mscodec.cxx.
References m_hDigest, and m_pDigestValue.
| bool svx::MSCodec_Std97::VerifyKey | ( | const sal_uInt8 | pSaltData[16], | |
| const sal_uInt8 | pSaltDigest[16] | |||
| ) |
Verifies the validity of the password using the passed salt data.
The codec must be initialized with InitKey() before this function can be used.
| pSaltData | Salt data block read from the file. | |
| pSaltDigest | Salt digest read from the file. |
Definition at line 293 of file mscodec.cxx.
References InitCipher(), m_hCipher, and m_hDigest.
| bool svx::MSCodec_Std97::InitCipher | ( | sal_uInt32 | nCounter | ) |
Rekeys the codec using the specified counter.
After reading a specific amount of data the cipher algorithm needs to be rekeyed using a counter that counts the data blocks.
The block size is for example 512 Bytes for Word files and 1024 Bytes for Excel files.
The codec must be initialized with InitKey() before this function can be used.
| nCounter | Block counter used to rekey the cipher. |
Definition at line 333 of file mscodec.cxx.
References m_hCipher, m_hDigest, and m_pDigestValue.
Referenced by VerifyKey().
| bool svx::MSCodec_Std97::Decode | ( | const void * | pData, | |
| sal_Size | nDatLen, | |||
| sal_uInt8 * | pBuffer, | |||
| sal_Size | nBufLen | |||
| ) |
Decodes a block of memory.
| pData | Encrypted source data block. | |
| nDatLen | Size of the passed source data block. | |
| pBuffer | Destination buffer for the decrypted data. | |
| nBufLen | Size of the destination buffer. |
Definition at line 370 of file mscodec.cxx.
References m_hCipher.
Referenced by Skip().
| bool svx::MSCodec_Std97::Skip | ( | sal_Size | nDatLen | ) |
Lets the cipher skip a specific amount of bytes.
This function sets the cipher to the same state as if the specified amount of data has been decoded with one or more calls of Decode().
The codec must be initialized with InitKey() before this function can be used.
| nDatLen | Number of bytes to be skipped (cipher "seeks" forward). |
Definition at line 382 of file mscodec.cxx.
References Decode().
| SVX_DLLPRIVATE MSCodec_Std97& svx::MSCodec_Std97::operator= | ( | const MSCodec_Std97 & | ) | [private] |
rtlCipher svx::MSCodec_Std97::m_hCipher [private] |
Definition at line 282 of file mscodec.hxx.
Referenced by Decode(), InitCipher(), MSCodec_Std97(), VerifyKey(), and ~MSCodec_Std97().
rtlDigest svx::MSCodec_Std97::m_hDigest [private] |
Definition at line 283 of file mscodec.hxx.
Referenced by InitCipher(), InitKey(), MSCodec_Std97(), VerifyKey(), and ~MSCodec_Std97().
sal_uInt8 svx::MSCodec_Std97::m_pDigestValue[RTL_DIGEST_LENGTH_MD5] [private] |
Definition at line 284 of file mscodec.hxx.
Referenced by InitCipher(), InitKey(), MSCodec_Std97(), and ~MSCodec_Std97().
1.5.6