Skip to content

Commit

Permalink
馃棑 Jun 19, 2023 11:15:29 PM
Browse files Browse the repository at this point in the history
馃敡 tests
  • Loading branch information
securisec committed Jun 20, 2023
1 parent 0040741 commit f9ae929
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions chepy/modules/encryptionencoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ def rot_47(self, rotation: int = 47) -> EncryptionEncodingT:
>>> Chepy("some").rot_47().out
"D@>6"
"""
decoded_string = ''
decoded_string = ""
for char in self._convert_to_str():
if ord(char) >= 33 and ord(char) <= 126:
decoded_char = chr((ord(char) - 33 + rotation) % 94 + 33)
decoded_string += decoded_char
else:
decoded_string += char
decoded_string += char # pragma: no cover
self.state = decoded_string
return self

Expand All @@ -186,13 +186,13 @@ def rot_47_bruteforce(self) -> EncryptionEncodingT:
hold = {}
data = self._convert_to_str()
for r in range(1, 94):
decoded_string = ''
decoded_string = ""
for char in data:
if ord(char) >= 33 and ord(char) <= 126:
decoded_char = chr((ord(char) - 33 + r) % 94 + 33)
decoded_string += decoded_char
else:
decoded_string += char
decoded_string += char # pragma: no cover
hold[str(r)] = decoded_string
self.state = hold
return self
Expand Down

0 comments on commit f9ae929

Please sign in to comment.