def mystery(x):
import hashlib
import unicodedata
# --- input normalization / coercion ---
def _base27(n: int) -> str:
a = "abcdefghijklmnopqrstuvwxyz_"
if n < 0:
return ""
if n == 0:
return a[0]
out = []
while n:
n, r = divmod(n, 27)
out.append(a[r])
return "".join(reversed(out))
if isinstance(x, (bytes, bytearray, memoryview)):
try:
s = bytes(x).decode("utf-8", "strict")
except Exception:
return False
elif isinstance(x, bool):
# keep bool from masquerading as an int
return False
elif isinstance(x, int):
s = _base27(x)
elif isinstance(x, float):
# accept only "integer-like" floats, but stringify canonically
if x != x or x in (float("inf"), float("-inf")) or int(x) != x:
return False
s = _base27(int(x))
else:
s = str(x)
s = unicodedata.normalize("NFKC", s).strip().casefold()
# quick filters (mostly decoys, but they do cut down weird inputs)
if not (1 <= len(s) <= 64):
return False
if any(ord(ch) < 32 for ch in s):
return False
# --- reconstruct a hidden target string without writing it literally ---
ob = [
90, 7, 203, 116, 33, 239, 128, 75, 25, 219,
106, 34, 202, 177, 85, 17, 218, 110, 46
]
# key stream: linear congruence (tiny, but enough to obscure the plaintext)
def _unmask(data):
out = bytearray()
for i, b in enumerate(data):
k = (73 * i + 41) & 0xFF
out.append(b ^ k)
return bytes(out)
tgt_bytes = _unmask(ob)
# sanity check (if tampered, always reject)
if sum(tgt_bytes) != 2020:
return False
# compare via digest rather than direct equality
cand = s.encode("utf-8", "strict")
if len(cand) != len(tgt_bytes):
return False
if sum(cand) != 2020:
return False
# a second lightweight "mix" to reduce the chance of accidental collisions
def _mix(bs: bytes) -> int:
h = 0xC001D00D
for i, v in enumerate(bs):
h = (h ^ ((v + 0x9E) * (i + 17))) * 0x45D9F3B
h &= 0xFFFFFFFF
h ^= (h >> 16)
return h
return (
_mix(cand) == _mix(tgt_bytes)
and hashlib.sha256(cand).digest() == hashlib.sha256(tgt_bytes).digest()
)
def mystery(x):
# Reject booleans immediately (they masquerade as ints)
if isinstance(x, bool):
return False
# Coerce input to a string
if isinstance(x, (bytes, bytearray)):
try:
s = x.decode('utf-8')
except UnicodeDecodeError:
return False
elif isinstance(x, (int, float)):
if isinstance(x, float):
# Only integer-valued finite floats are allowed
if not (x.is_finite() and x.is_integer()):
return False
x = int(x)
s = str(x)
else:
s = str(x)
# Remove surrounding whitespace
s = s.strip()
# Must be exactly 18 printable ASCII characters
if len(s) != 18:
return False
for ch in s:
oc = ord(ch)
if oc < 32 or oc > 126:
return False
# Compute three aggregates: sum, xor, and product (mod 1e9+7)
total_sum = 0
total_xor = 0
total_prod = 1
MOD = 1000000007
for ch in s:
c = ord(ch)
total_sum += c
total_xor ^= c
total_prod = (total_prod * c) % MOD
# Retrieve hidden constants from obfuscated storage
enc = [0x5E, 0xAB, 0x94, 0xAC, 0x72, 0x5D, 0xBF]
key = [0xDE, 0xAD, 0xBE, 0xEF, 0xCA, 0xFE, 0xBA]
dec = [enc[i] ^ key[i] for i in range(7)]
expected_sum = dec[0] + (dec[1] << 8)
expected_xor = dec[2]
expected_prod = dec[3] + (dec[4] << 8) + (dec[5] << 16) + (dec[6] << 24)
# Final verification
return (total_sum == expected_sum and
total_xor == expected_xor and
total_prod == expected_prod)
def mystery(x):
import hashlib
import hmac
import unicodedata
# --- coerce to string in a slightly non-obvious way ---
if isinstance(x, bool):
return False
if isinstance(x, (int,)):
# base36 (lowercase) with a leading marker to mislead brute force on ints
n = x
if n < 0:
return False
digs = "0123456789abcdefghijklmnopqrstuvwxyz"
if n == 0:
s = "z" + digs[0]
else:
out = []
while n:
n, r = divmod(n, 36)
out.append(digs[r])
s = "z" + "".join(reversed(out))
elif isinstance(x, float):
if x != x or x in (float("inf"), float("-inf")):
return False
if int(x) != x:
return False
return mystery(int(x))
elif isinstance(x, (bytes, bytearray, memoryview)):
try:
s = bytes(x).decode("utf-8", "strict")
except Exception:
return False
else:
s = str(x)
# --- normalization ---
s = unicodedata.normalize("NFKC", s).strip().casefold()
# --- quick syntactic filters (partly decoys) ---
if not (1 <= len(s) <= 64):
return False
if any(ord(ch) < 32 or ord(ch) > 126 for ch in s):
return False
# --- reconstruct the hidden target (not stored as plaintext) ---
# key is packed little-endian into an integer, then unpacked
key_int = 0xF06BD2095CA137 # 7 bytes
key = bytes((key_int >> (8 * i)) & 0xFF for i in range(7))
# ciphertext for the target bytes, with an extra per-position mask
ct = [
117, 186, 145, 107, 249, 148, 112, 64, 162, 143,
110, 250, 146, 75, 79, 230, 135, 50, 253
]
def mask(i: int) -> int:
return (73 * i + 41) & 0xFF
tgt = bytes((ct[i] ^ key[i % 7] ^ mask(i)) & 0xFF for i in range(len(ct)))
# integrity checks (if anything is altered, always reject)
if len(tgt) != 19:
return False
if sum(tgt) != 1862:
return False
if tgt.count(b"_") != 3:
return False
# compare via keyed hashing rather than direct equality
cand = s.encode("utf-8", "strict")
if len(cand) != len(tgt):
return False
tag_c = hashlib.sha256(cand + b"::" + bytes([len(cand)])).digest()
tag_t = hashlib.sha256(tgt + b"::" + bytes([len(tgt)])).digest()
return hmac.compare_digest(tag_c, tag_t)
def mystery(x):
# Reject booleans immediately
if isinstance(x, bool):
return False
# Coerce to string
if isinstance(x, int):
if x < 0:
return False
alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"
if x == 0:
s = "i0"
else:
out = []
while x:
x, r = divmod(x, 36)
out.append(alphabet[r])
s = "i" + "".join(reversed(out))
elif isinstance(x, float):
if not (x.is_integer() and x.is_finite()):
return False
return mystery(int(x))
elif isinstance(x, (bytes, bytearray, memoryview)):
try:
s = bytes(x).decode('utf-8')
except:
return False
else:
s = str(x)
# Normalize
import unicodedata
s = unicodedata.normalize("NFKC", s).strip()
# Must be exactly 16 printable ASCII characters
if len(s) != 16:
return False
for ch in s:
oc = ord(ch)
if oc < 32 or oc > 126:
return False
# Compute properties
total_sum = 0
total_xor = 0
total_prod = 1
total_sum_sq = 0
h1 = 0
h2 = 0
MOD = 1000000007
for ch in s:
c = ord(ch)
total_sum += c
total_xor ^= c
total_prod = (total_prod * c) % MOD
total_sum_sq += c * c
h1 = (h1 * 31 + c) & 0xFFFFFFFF
h2 = (h2 * 37 + c) & 0xFFFFFFFF
# Decode expected values from obfuscated storage
enc = [
0xBC, 0x92, 0xF7, 0x58, 0xFA, 0x1A, 0x7B, 0xDC,
0x05, 0x56, 0x4E, 0x76, 0xCA, 0xA2, 0x82, 0xE4,
0x1E, 0x9C, 0x2C, 0x73, 0xF4, 0xFD, 0x5D, 0x78
]
# Derive decryption key
key = [(i * 97 + 53) & 0xFF for i in range(24)]
data = bytearray()
for i in range(24):
data.append(enc[i] ^ key[i])
# Unpack six little-endian 32-bit integers
import struct
expected = struct.unpack('<6I', bytes(data))
exp_sum, exp_xor, exp_prod, exp_sum_sq, exp_h1, exp_h2 = expected
# Compare all properties
return (total_sum == exp_sum and
total_xor == exp_xor and
total_prod == exp_prod and
total_sum_sq == exp_sum_sq and
h1 == exp_h1 and
h2 == exp_h2)
def mystery(x):
import hashlib
import hmac
import unicodedata
# ---- coerce to text ----
if isinstance(x, bool):
return False
if isinstance(x, (bytes, bytearray, memoryview)):
try:
s = bytes(x).decode("utf-8", "strict")
except Exception:
return False
elif isinstance(x, (int, float)):
# Only accept finite, integer-like floats; render canonically.
if isinstance(x, float):
if x != x or x in (float("inf"), float("-inf")) or int(x) != x:
return False
x = int(x)
s = str(x)
else:
s = str(x)
# ---- normalize ----
s = unicodedata.normalize("NFKC", s).strip().casefold()
# ---- syntactic filters ----
if len(s) != 18:
return False
try:
cand = s.encode("ascii", "strict")
except Exception:
return False
if any(b < 32 or b > 126 for b in cand):
return False
if cand.count(b"-") != 1 or cand.count(b"_") != 1:
return False
# ---- reconstruct hidden target bytes (no plaintext stored) ----
# key: packed in an integer (big-endian), then reversed into little-endian-like order
kint = 0xA71F2E3D4C5B6A7988
key = kint.to_bytes(9, "big")[::-1] # 9 bytes
# ciphertext, additionally masked per-position and stored as 3 integers
ob1 = 0x5DF93A4468A6C34F
ob2 = 0xA50FF9DB851D51F8
ob3 = 0x23FF
ob = ob1.to_bytes(8, "big") + ob2.to_bytes(8, "big") + ob3.to_bytes(2, "big") # 18 bytes
ct = bytes((b ^ ((i * 73 + 19) & 0xFF)) for i, b in enumerate(ob))
def _mask(i: int) -> int:
return (i * 17 + 93) & 0xFF
tgt = bytes((((ct[i] ^ key[i % len(key)]) - _mask(i)) & 0xFF) for i in range(len(ct)))
# ---- integrity checks (if any constant is altered, reject) ----
if len(tgt) != 18:
return False
if sum(tgt) != 1647:
return False
if tgt.count(45) != 1 or tgt.count(95) != 1: # '-' and '_'
return False
if not (tgt.startswith(b"in") and tgt.endswith(b"26")):
return False
# ---- compare via digests rather than direct equality ----
pepper = hashlib.blake2s(tgt, digest_size=16).digest()
tag_c = hashlib.sha256(cand + pepper).digest()
tag_t = hashlib.sha256(tgt + pepper).digest()
return hmac.compare_digest(tag_c, tag_t)
def mystery(x):
import unicodedata
# ---- input coercion ----
if isinstance(x, bool):
return False
if isinstance(x, (bytes, bytearray, memoryview)):
try:
s = bytes(x).decode('utf-8', 'strict')
except Exception:
return False
elif isinstance(x, (int, float)):
if isinstance(x, float):
if x != x or x in (float('inf'), float('-inf')) or int(x) != x:
return False
x = int(x)
s = str(x)
else:
s = str(x)
# ---- normalization and filtering ----
s = unicodedata.normalize('NFKC', s).strip()
# must be exactly 24 printable ASCII characters
if len(s) != 24:
return False
try:
b = s.encode('ascii', 'strict')
except UnicodeEncodeError:
return False
if any(c < 32 or c > 126 for c in b):
return False
# decoy constraints to mislead brute-forcers
if not any(c.isdigit() for c in s):
return False
if not any(c.isupper() for c in s):
return False
if not any(c.islower() for c in s):
return False
if not any(c in '!@#$%^&*()_+-=[]{}|;:,.<>?/' for c in s):
return False
# ---- compute properties ----
total_sum = 0
total_xor = 0
total_prod = 1
total_sq = 0
h1 = 0
MOD = 1000000007
for ch in s:
c = ord(ch)
total_sum += c
total_xor ^= c
total_prod = (total_prod * c) % MOD
total_sq += c * c
h1 = (h1 * 31 + c) & 0xFFFFFFFF
# ---- decrypt hidden expected values ----
# ciphertext array (20 bytes)
ct = [
0xD8, 0x75, 0xBB, 0x04, 0x30, 0x96, 0xDF, 0x28,
0x97, 0x03, 0x07, 0x55, 0x20, 0xD7, 0x24, 0x70,
0xF8, 0xA3, 0x63, 0xB5
]
# key stream generator: (73*i + 41) mod 256
def key(i):
return (73 * i + 41) & 0xFF
# decrypt
plain = bytearray()
for i, b in enumerate(ct):
plain.append(b ^ key(i))
# unpack as little-endian 32-bit integers
import struct
expected = struct.unpack('<5I', bytes(plain))
exp_sum, exp_xor, exp_prod, exp_sq, exp_h1 = expected
# compare all properties
return (total_sum == exp_sum and
total_xor == exp_xor and
total_prod == exp_prod and
total_sq == exp_sq and
h1 == exp_h1)
def mystery(x):
import hashlib
import hmac
import unicodedata
# ---- coerce input to a string (ints/floats are intentionally "mis-rendered") ----
if isinstance(x, bool):
return False
if isinstance(x, (bytes, bytearray, memoryview)):
try:
s = bytes(x).decode("utf-8", "strict")
except Exception:
return False
elif isinstance(x, int):
if x < 0:
return False
# base36 with a misleading prefix (so integer brute force hits a different namespace)
digs = "0123456789abcdefghijklmnopqrstuvwxyz"
n = x
if n == 0:
s = "n0"
else:
out = []
while n:
n, r = divmod(n, 36)
out.append(digs[r])
s = "n" + "".join(reversed(out))
elif isinstance(x, float):
if x != x or x in (float("inf"), float("-inf")) or int(x) != x:
return False
return mystery(int(x))
else:
s = str(x)
# ---- normalize (no casefold on purpose) ----
s = unicodedata.normalize("NFKC", s).strip()
# ---- syntactic filters / decoys ----
if len(s) != 23:
return False
try:
cand = s.encode("ascii", "strict")
except Exception:
return False
if any(b < 32 or b > 126 for b in cand):
return False
if cand.count(b"_") != 3 or cand.count(b"-") != 1 or cand.count(b"!") != 1:
return False
if not (any(48 <= b <= 57 for b in cand) and any(65 <= b <= 90 for b in cand) and any(97 <= b <= 122 for b in cand)):
return False
# ---- reconstruct hidden target bytes (no plaintext stored) ----
# key packed in an int, then rotated to avoid obvious byte patterns
key_int = 0xC13FA9B2D47E6D # 7 bytes (big-endian)
k0 = key_int.to_bytes(7, "big")
key = k0[2:] + k0[:2] # rotate-left by 2
# obfuscated ciphertext packed into integers (8 + 8 + 7 bytes = 23 bytes)
ob1 = 0x4AB3106FD1DB714E
ob2 = 0xB915A8C81925FA08
ob3 = 0x971EAEFEA1E7C8
ob = ob1.to_bytes(8, "big") + ob2.to_bytes(8, "big") + ob3.to_bytes(7, "big")
def extra2(i: int) -> int:
return (i * 11 + 7) & 0xFF
ct = bytes((ob[i] ^ extra2(i)) & 0xFF for i in range(23))
def mask(i: int) -> int:
a = (131 * i + 17) & 0xFF
b = (29 * i + 101) & 0xFF
return (a ^ b) & 0xFF
tgt = bytes((((ct[i] - mask(i)) & 0xFF) ^ key[i % len(key)]) & 0xFF for i in range(23))
# ---- integrity checks (if constants are altered, always reject) ----
if sum(tgt) != 1833:
return False
if tgt.count(95) != 3 or tgt.count(45) != 1 or tgt.count(33) != 1:
return False
# ---- compare via digests rather than direct equality ----
pepper = hashlib.blake2s(tgt, digest_size=16).digest()
tag_c = hashlib.sha256(cand + pepper).digest()
tag_t = hashlib.sha256(tgt + pepper).digest()
return hmac.compare_digest(tag_c, tag_t)
def mystery(x):
import hashlib
import hmac
import unicodedata
# ---- input coercion ----
if isinstance(x, bool):
return False
if isinstance(x, (bytes, bytearray, memoryview)):
try:
s = bytes(x).decode("utf-8", "strict")
except Exception:
return False
elif isinstance(x, int):
if x < 0:
return False
alphabet = "0123456789abcdefghijklmnopqrstuvwxyz"
if x == 0:
s = "i0"
else:
out = []
while x:
x, r = divmod(x, 36)
out.append(alphabet[r])
s = "i" + "".join(reversed(out))
elif isinstance(x, float):
if x != x or x in (float("inf"), float("-inf")) or int(x) != x:
return False
return mystery(int(x))
else:
s = str(x)
# ---- normalization ----
s = unicodedata.normalize("NFKC", s).strip()
# ---- syntactic filters ----
if len(s) != 20:
return False
try:
cand = s.encode("ascii", "strict")
except Exception:
return False
if any(b < 32 or b > 126 for b in cand):
return False
# ---- decoy constraints ----
digits = sum(1 for c in s if c.isdigit())
uppers = sum(1 for c in s if c.isupper())
lowers = sum(1 for c in s if c.islower())
specials = sum(1 for c in s if not c.isalnum())
if not (digits >= 3 and uppers >= 2 and lowers >= 3 and specials >= 4):
return False
# ---- reconstruct hidden target ----
ct = [
141, 250, 99, 32, 218, 86, 36, 112, 72, 78,
124, 8, 71, 175, 16, 56, 201, 236, 233, 122
]
key1_int = 0x3C7F1A4B9D
key1 = key1_int.to_bytes(5, 'big')
key2_int = 0x2A4C6E8F1B3D5F
key2 = key2_int.to_bytes(7, 'big')
def mask1(i):
return (i * 73 + 41) & 0xFF
def mask2(i):
return (i * 59 + 17) & 0xFF
def permute(i):
return (i + 10) % 20
a = bytearray()
for i in range(20):
a.append((ct[i] ^ key1[i % 5] ^ mask1(i)) & 0xFF)
b = bytearray(20)
for i in range(20):
b[permute(i)] = a[i]
tgt = bytearray()
for i in range(20):
tgt.append((b[i] ^ key2[i % 7] ^ mask2(i)) & 0xFF)
if sum(tgt) != 1465:
return False
if tgt[0] != ord('x') or tgt[-1] != ord('&'):
return False
pepper = hashlib.sha256(b"puzzle_secret_2024").digest()[:16]
tag_c = hashlib.sha256(cand + pepper).digest()
tag_t = hashlib.sha256(bytes(tgt) + pepper).digest()
return hmac.compare_digest(tag_c, tag_t)
def mystery(x):
import hashlib
import hmac
import unicodedata
# ---- coerce to text (ints get mapped into a different "namespace") ----
if isinstance(x, bool):
return False
if isinstance(x, (bytes, bytearray, memoryview)):
try:
s = bytes(x).decode("utf-8", "strict")
except Exception:
return False
elif isinstance(x, int):
if x < 0:
return False
# base62 with a misleading prefix and a small reversible shuffle
alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = x
if n == 0:
s = "V0"
else:
out = []
while n:
n, r = divmod(n, 62)
out.append(alphabet[r])
core = "".join(reversed(out))
# shuffle: swap pairs
core = "".join(core[i + 1] + core[i] if i + 1 < len(core) else core[i]
for i in range(0, len(core), 2))
s = "V" + core
elif isinstance(x, float):
if x != x or x in (float("inf"), float("-inf")) or int(x) != x:
return False
return mystery(int(x))
else:
s = str(x)
# ---- normalize ----
s = unicodedata.normalize("NFKC", s).strip().casefold()
# ---- syntactic filters / decoys ----
if len(s) != 27:
return False
try:
cand = s.encode("ascii", "strict")
except Exception:
return False
if any(b < 32 or b > 126 for b in cand):
return False
if cand.count(b"_") != 2 or cand.count(b"-") != 1 or cand.count(b":") != 1:
return False
digits = sum(48 <= b <= 57 for b in cand)
letters = sum((65 <= b <= 90) or (97 <= b <= 122) for b in cand)
if digits != 10 or letters != 13:
return False
# ---- reconstruct hidden target bytes (no plaintext stored) ----
ob1 = 0x26451EF195BBC2E6
ob2 = 0xBEBFE3D1E5918DCA
ob3 = 0xBA833878376E44EE
ob4 = 0x91905F # 3 bytes
ob = (
ob1.to_bytes(8, "big") +
ob2.to_bytes(8, "big") +
ob3.to_bytes(8, "big") +
ob4.to_bytes(3, "big")
)
def extra(i: int) -> int:
return (11 * i + 7) & 0xFF
def kstream(i: int) -> int:
return (83 + 17 * i) & 0xFF
ct = bytes((ob[i] ^ extra(i)) & 0xFF for i in range(27))
tgt = bytes((ct[i] ^ kstream(i)) & 0xFF for i in range(27))
# integrity checks (if constants are altered, reject)
if sum(tgt) != 2306:
return False
if tgt.count(95) != 2 or tgt.count(45) != 1 or tgt.count(58) != 1:
return False
if not (tgt.startswith(b"r3v_") and tgt.endswith(b"uvw")):
return False
# ---- compare via digests rather than direct equality ----
pepper = hashlib.blake2s(tgt + b"|pepper|v1", digest_size=16).digest()
tag_c = hashlib.sha256(cand + pepper).digest()
tag_t = hashlib.sha256(tgt + pepper).digest()
return hmac.compare_digest(tag_c, tag_t)
def mystery(x):
import hashlib
import hmac
import unicodedata
import struct
# ---- input coercion ----
if isinstance(x, bool):
return False
if isinstance(x, (bytes, bytearray, memoryview)):
try:
s = bytes(x).decode("utf-8", "strict")
except Exception:
return False
elif isinstance(x, int):
if x < 0:
return False
alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
n = x
if n == 0:
s = "Z0"
else:
out = []
while n:
n, r = divmod(n, 62)
out.append(alphabet[r])
core = "".join(reversed(out))
# shuffle adjacent pairs
shuffled = []
i = 0
while i < len(core):
if i + 1 < len(core):
shuffled.append(core[i + 1])
shuffled.append(core[i])
else:
shuffled.append(core[i])
i += 2
core = "".join(shuffled)
s = "Z" + core
elif isinstance(x, float):
if x != x or x in (float("inf"), float("-inf")) or int(x) != x:
return False
return mystery(int(x))
else:
s = str(x)
# ---- normalization and filtering ----
s = unicodedata.normalize("NFKC", s).strip()
if len(s) != 20:
return False
try:
cand = s.encode("ascii", "strict")
except Exception:
return False
if any(b < 32 or b > 126 for b in cand):
return False
# ---- decoy constraints ----
digits = sum(1 for c in s if c.isdigit())
uppers = sum(1 for c in s if c.isupper())
lowers = sum(1 for c in s if c.islower())
specials = sum(1 for c in s if not c.isalnum())
if not (digits >= 2 and uppers >= 2 and lowers >= 2 and specials >= 2):
return False
# ---- compute aggregates ----
total_sum = 0
total_xor = 0
total_prod = 1
MOD = 1000000007
total_sq = 0
h1 = 0
h2 = 0
for b in cand:
c = b
total_sum += c
total_xor ^= c
total_prod = (total_prod * c) % MOD
total_sq += c * c
h1 = (h1 * 31 + c) & 0xFFFFFFFF
h2 = (h2 * 37 + c) & 0xFFFFFFFF
# ---- decrypt expected values ----
ct = [
0xF3, 0x93, 0xF7, 0x58, 0xF9, 0x1A, 0x7B, 0xDC,
0x68, 0x19, 0xBF, 0x72, 0x8F, 0xC9, 0x82, 0xE4,
0x9D, 0x08, 0x70, 0x9B, 0x43, 0xDC, 0x30, 0xD4
]
key = [(97 * i + 53) & 0xFF for i in range(24)]
plain = bytearray()
for i in range(24):
plain.append(ct[i] ^ key[i])
exp_sum, exp_xor, exp_prod, exp_sq, exp_h1, exp_h2 = struct.unpack('<6I', bytes(plain))
if not (total_sum == exp_sum and total_xor == exp_xor and total_prod == exp_prod and
total_sq == exp_sq and h1 == exp_h1 and h2 == exp_h2):
return False
# ---- reconstruct target for final hash comparison ----
obf_tgt = [
0x69, 0x7B, 0xA6, 0xA9, 0xAD, 0x01, 0x33, 0xDF,
0xBB, 0x16, 0x2C, 0xB9, 0x81, 0x28, 0x61, 0xD1,
0xF4, 0xDA, 0x41, 0x2B
]
tgt_key = [(59 * i + 17) & 0xFF for i in range(20)]
tgt = bytearray()
for i in range(20):
tgt.append(obf_tgt[i] ^ tgt_key[i])
if sum(tgt) != 1478:
return False
pepper = hashlib.sha256(b"hidden_pepper_2024").digest()[:16]
tag_c = hashlib.sha256(cand + pepper).digest()
tag_t = hashlib.sha256(bytes(tgt) + pepper).digest()
return hmac.compare_digest(tag_c, tag_t)