Skip to content

Commit 6b59a84

Browse files
authored
Merge pull request #12 from theilgaard/add-error-on-no-valid-padding
Add RuntimeError when no valid padding found
2 parents 1cb481f + 11c9920 commit 6b59a84

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

DecryptEngine.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def decryptAtIndex(self, ciphertext, index):
1414
testCt[index] = chr(guess)
1515
if self.padChecker.hasValidPadding(testCt):
1616
return guess
17+
raise RuntimeError("[!] Found no valid padding, is PadChecker implemented correctly?")
1718

1819
def decryptBlock(self, block):
1920
iv = bytearray("\x00"*BLOCKSIZE)

0 commit comments

Comments
 (0)