[GEMINI] Add test case for unique ROT13 metadata decoding
This commit is contained in:
@@ -118,3 +118,18 @@ def test_try_decode_metadata_unanchored():
|
|||||||
res = try_decode_metadata("steghide:cEF6endvcmQ=")
|
res = try_decode_metadata("steghide:cEF6endvcmQ=")
|
||||||
assert res.get("base64") == "pAzzword"
|
assert res.get("base64") == "pAzzword"
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
# {{{ test_try_decode_metadata_rot13_unique_only
|
||||||
|
def test_try_decode_metadata_rot13_unique_only():
|
||||||
|
"""
|
||||||
|
Verifies that rot13 only decodes unique flags and ignores flags already visible.
|
||||||
|
"""
|
||||||
|
# Case 1: Flag is encoded and not present in plaintext in the original string.
|
||||||
|
res = try_decode_metadata("synt{ebg13_havdhr}")
|
||||||
|
assert res.get("rot13") == "flag{rot13_unique}"
|
||||||
|
|
||||||
|
# Case 2: Flag is already present in plaintext in the original string.
|
||||||
|
res_duplicate = try_decode_metadata("flag{rot13_unique} synt{ebg13_havdhr}")
|
||||||
|
assert "rot13" not in res_duplicate
|
||||||
|
# }}}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user