We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3a5fefb commit ec2990aCopy full SHA for ec2990a
src/padding_oracle/solver.py
@@ -52,7 +52,7 @@ def remove_padding(data: Union[str, bytes]):
52
53
54
def plaintext_list_to_bytes(plaintext_list, unknown=b' '):
55
- plaintext_bytes = bytes(unknown if b is None else b
+ plaintext_bytes = bytes(ord(unknown) if b is None else b
56
for b in plaintext_list)
57
return plaintext_bytes
58
@@ -61,7 +61,7 @@ def solve(**kwargs):
61
cipher = kwargs.pop('cipher')
62
unknown = kwargs.pop('unknown', b' ')
63
solver = Solver(**kwargs)
64
- plaintext = plaintext_list_to_bytes(solver.solve(cipher))
+ plaintext = plaintext_list_to_bytes(solver.solve(cipher), unknown)
65
plaintext = remove_padding(plaintext)
66
return plaintext
67
0 commit comments