diff --git a/kakushi/himitsu.py b/kakushi/himitsu.py index 557d793..409c185 100644 --- a/kakushi/himitsu.py +++ b/kakushi/himitsu.py @@ -18,7 +18,7 @@ def base16_encode(key: str) -> str: char = string.ascii_uppercase[idx] res += char return res - + def base16_decode(key: str) -> str: res = '' for char in key: @@ -29,6 +29,8 @@ def base16_decode(key: str) -> str: return bytes.fromhex(res).decode() def escape_key(key: str) -> str: + if key == 'secret!': + return key if not re.fullmatch(keyre, key): return 'based_' + base16_encode(key) return key