From d6832ffbf5a214d54d0e976e40fa47489ccd1104 Mon Sep 17 00:00:00 2001 From: J <47265397+UserJHansen@users.noreply.github.com> Date: Wed, 22 May 2024 19:15:37 +1000 Subject: [PATCH 1/2] Fix for incorrect key size with 0 length keySize var I have found several pptx samples which don't have a proper keySize set. Since 0 is an incorrect key size this change increases the chance that the file will still be readable. --- msoffcrypto/format/common.py | 1 + 1 file changed, 1 insertion(+) diff --git a/msoffcrypto/format/common.py b/msoffcrypto/format/common.py index 1821229..8f401be 100644 --- a/msoffcrypto/format/common.py +++ b/msoffcrypto/format/common.py @@ -13,6 +13,7 @@ def _parse_encryptionheader(blob): (algId,) = unpack(" Date: Fri, 24 May 2024 02:07:18 +0900 Subject: [PATCH 2/2] Update based on the spec (RC4 CryptoAPI Encryption Header) --- msoffcrypto/format/common.py | 24 +++++++++++++++++++++++- msoffcrypto/format/doc97.py | 21 +-------------------- msoffcrypto/format/ppt97.py | 21 +-------------------- msoffcrypto/format/xls97.py | 21 +-------------------- 4 files changed, 26 insertions(+), 61 deletions(-) diff --git a/msoffcrypto/format/common.py b/msoffcrypto/format/common.py index 8f401be..b5c6060 100644 --- a/msoffcrypto/format/common.py +++ b/msoffcrypto/format/common.py @@ -1,3 +1,4 @@ +import io import logging from struct import unpack @@ -13,7 +14,6 @@ def _parse_encryptionheader(blob): (algId,) = unpack("