Skip to content

Tap Code decoder realigns pairs after invalid coordinates #16

Description

@aeitwoen

The Tap Code decoder removes invalid numbers before grouping coordinates into pairs. That can turn malformed ciphertext into plausible but wrong plaintext instead of reporting an error.

This showed up with decode("2 3 0 1 5"): the invalid 0 is filtered out, the remaining values are regrouped as 2 3 and 1 5, and the decoder returns HE. The decoder should validate the original token stream and reject invalid coordinates or an odd number of values through the existing CipherError hierarchy. A regression case for this input would catch the dangerous part, which is the silent pair realignment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions