Talk:Playfair cipher: Difference between revisions

added a couple of REXX examples that handle multiple Xes in the plain text.
(→‎Inadequate spec: new section)
 
(added a couple of REXX examples that handle multiple Xes in the plain text.)
Line 2:
 
How should one encode a sentence containing "xxx"? Or should the implementation crash for that case? --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 05:04, 28 May 2014 (UTC)
 
-----
 
The REXX program handles these two examples (below) without problems.
 
Note the   '''('''   [left parenthesis] is used to parse the plaintext from any specified options.
 
'''output''' when using the input of: &nbsp; <tt> ( I like XXX better than XX beer. </tt>
<pre>
old cipher key: Playfair example. ◄───using the default.
new cipher key: PLAYFIREXM
omit char: J
double char: X
original text: I like XXX better then XX beer.
 
cleansed text: IL IK EX XX BE TT ER TH EN XX BE ER
ILIKEXXXBETTERTHENXXBEER
 
encrypted text: RP BT XM MM MM DI WI VI IU DM QR MM DI MX EM
RPBTXMMMMMDIWIVIIUDMQRMMDIMXEM
 
plain text: IL IK EX XX XX BE TX TE RT HE NX XX BE XE RX
ILIKEXXXXXBETXTERTHENXXXBEXERX
 
possible text: IL IK EX XX BE TT ER TH EN XX BE ER
ILIKEXXXBETTERTHENXXBEER
original text: ILIKEXXXBETTERTHENXXBEER
 
════════════════Playfair encryption──► decryption──► encryption worked.
</pre>
'''output''' when the input is: &nbsp; <tt> (triple xxx is like, thirty, dude. No XXXX though. Bummer. </tt>
<pre>
old cipher key: Playfair example. ◄───using the default.
new cipher key: PLAYFIREXM
omit char: J
double char: X
original text: triple xxx is like, thirty, dude. No XXXX though. Bummer.
 
cleansed text: TR IP LE XX XI SL IK ET HI RT YD UD EN OX XX XT HO UG HB UM ME R
TRIPLEXXXISLIKETHIRTYDUDENOXXXXTHOUGHBUMMER
 
encrypted text: UI BI AR MM MM MR NF BT IV BM IU AG VC RO QE MM MM MM ZB NV HB CT IM IX EM
UIBIARMMMMMRNFBTIVBMIUAGVCROQEMMMMMMZBNVHBCTIMIXEM
 
plain text: TR IP LE XX XX XI SL IK ET HI RT YD UD EN OX XX XX XX TH OU GH BU MX ME RX
TRIPLEXXXXXISLIKETHIRTYDUDENOXXXXXXXTHOUGHBUMXMERX
 
possible text: TR IP LE XX XI SL IK ET HI RT YD UD EN OX XX XT HO UG HB UM ME R
TRIPLEXXXISLIKETHIRTYDUDENOXXXXTHOUGHBUMMER
original text: TRIPLEXXXISLIKETHIRTYDUDENOXXXXTHOUGHBUMMER
 
════════════════Playfair encryption──► decryption──► encryption worked.
</pre>