From f300f2c5387591b0fc517e7fdee6b5dc9644c496 Mon Sep 17 00:00:00 2001 From: ptrcnull Date: Wed, 6 Nov 2024 04:20:45 +0100 Subject: [PATCH] fix: do not escape 'secret!' --- kakushi/himitsu.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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