diff --git a/chepy/chepy_plugins b/chepy/chepy_plugins index b01126f..ebca7ce 160000 --- a/chepy/chepy_plugins +++ b/chepy/chepy_plugins @@ -1 +1 @@ -Subproject commit b01126f84260d4d5c9cf397c8aea1fdc2893b1a6 +Subproject commit ebca7ceab0697d77d2f4d9736516bece24c9df1e diff --git a/chepy/modules/encryptionencoding.py b/chepy/modules/encryptionencoding.py index 4925a0e..2adef72 100644 --- a/chepy/modules/encryptionencoding.py +++ b/chepy/modules/encryptionencoding.py @@ -341,13 +341,18 @@ def xor( elif key_type == "base64": key = binascii.hexlify(base64.b64decode(key.encode())) elif key_type == "decimal": - key = binascii.hexlify( - int(key).to_bytes(len(str(key)), byteorder="big") - ) + if int(key) < 0 or int(key) > 255: + raise ValueError("Invalid decimal key") # pragma: no cover - key = binascii.unhexlify(key) - for char, key_val in zip(self._convert_to_bytes(), itertools.cycle(key)): - x.append(char ^ key_val) + _s = self._convert_to_bytes() + + if key_type == "decimal": + for b in _s: + x.append(b ^ int(key)) + else: + key = binascii.unhexlify(key) + for char, key_val in zip(_s, itertools.cycle(key)): + x.append(char ^ key_val) self.state = bytes(x) return self diff --git a/docs/conf.py b/docs/conf.py index ab47a78..ccce7ec 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,8 +26,8 @@ def setup(app): # -- Project information ----------------------------------------------------- project = "Chepy" -copyright = "2019, Hapsida @securisec" -author = "Hapsida @securisec" +copyright = "2019, @securisec" +author = "@securisec" master_doc = 'index'