Talk:Playfair cipher: Difference between revisions

Content added Content deleted
(added a couple of REXX examples that handle multiple Xes in the plain text.)
Line 55: Line 55:
════════════════Playfair encryption──► decryption──► encryption worked.
════════════════Playfair encryption──► decryption──► encryption worked.
</pre>
</pre>

::Of course this kind of thing is doable. But it's also unspecified behavior. I adopted something which I felt was closer to the spirit of the spec, for the J implementation, mangling some repeated X's in the process. Here's how that looks using your test cases:

::<lang J> choose 'IJ'

setkey 'playfirexm'
encrypt 'I like XXX better than XX beer.'
RPBTXMGWDIWIXEZBLOGWDIXE
decrypt encrypt 'I like XXX better than XX beer.'
ILIKEXXQBETXERTHANXQBEER
encrypt 'triple xxx is like, thirty, dude. No XXXX though. Bummer.'
UIBIARGWMRNFBTIVBMIUAGVCROQEGWIWDSWCBCZRIXEM
decrypt encrypt 'triple xxx is like, thirty, dude. No XXXX though. Bummer.'
TRIPLEXQXISLIKETHIRTYDUDENOXXQXTHOUGHBUMMERX</lang>