Ciphers
Bifid
Polybius coordinates written in two rows, read across by period, turned back into letters. Fractionation and transposition in one.
- create
- create("bifid")
- family
- Fractionation
- options
- --key? --period?
- self-inverse
- no
- keyspace
- 25! × period variants
- try it
- ciphers bifid "FLEE AT ONCE" --key BICONDITIONAL --period 5
Delastelle's Bifid takes each letter's row and column from a 5×5 square, writes all the rows above all the columns in blocks of period letters, then reads each block row by row in pairs and looks the pairs up again. One letter's coordinates end up spread over two output letters, and that spread is what makes it stronger than plain Polybius. The square is the one Playfair builds - key first, J folded into I. Default period is 5. Non-letters are dropped, output is uppercase.
const bifid = create("bifid");
bifid.encode("FLEE AT ONCE", { key: "BICONDITIONAL", period: 5 }).text; // "GTDUXDBTUM"
bifid.encode("FLEE AT ONCE", { period: 5 }).text; // "HAAEVSLDSP"
bifid.decode("GTDUXDBTUM", { key: "BICONDITIONAL", period: 5 }).text; // "FLEEATONCE"
period must be a positive integer. Longer than the text means the whole text is one block.