Talk:ADFGVX cipher

Revision as of 17:43, 16 August 2021 by Thundergnat (talk | contribs) (Ambiguous handling of rows with less than keyword chars elements)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Rows with fewer than key chars elements?

It doesn't seem to be spelled out specifically anywhere. How should we handle ending rows with fewer elements than the number of characters in the key word? If you look at the wikipedia page under "Operation" the keyword is CARGO (5 letters), the message has 12 letters, resulting in 24 elements. When the columns are rearranged, the R column [AFAFX] goes to the end, and the O column [AFAX] moves 1 space to the left. But the last element of the R column [X] gets shifted over to fill the gap; so now O is [AFAXX] and R is [AFAF].

I choose to follow the wikipedia example and shift to fill any gaps after rearranging columns. The order can be recovered by simply compressing the last row to the left after reshuffling. See the Raku example. --Thundergnat (talk) 17:43, 16 August 2021 (UTC)

Return to "ADFGVX cipher" page.