|
Previous | Table of Contents | Next |
Caesar Cipher
Julius Caesar was one of the first to use substitution encryption to send messages to troops during war. The substitution method he is credited with involves advancing each character three spaces in the alphabet. Thus:
DIAL THE NUMBER OF THE NEW PARTY AND WAIT FOR AN ANSWER
becomes
GLDO WKH QXPEHU RI WKH QHZ SDUWB DQG ZDLW IRU DQ DQVZHU
Note that at the end of the alphabet, characters wrap back around to the beginning; thus, Z becomes C, Y becomes B, and so on.
This encrypting method serves its purpose well, but once one figures out that they need only subtract three characters from each given to obtain the correct answer, the code loses all security. A modification of this is allowing the number of characters shifted to differ for each message. In so doing, the number of possibilities changes from 1 to 26 and becomes increasingly more difficult.
Figure 10.8 shows an example of the ENCRYPT utility included on the CD with this book, and uses a modified version of the Caesar Cipher to change a message 10 spaces. Figure 10.9 shows how the same message is decrypted.
Figure 10.8 Encrypting using a modified version of the Caesar Cipher.
Figure 10.9 Decrypting using a modified version of the Caesar Cipher.
Although this method is stronger than always shifting three characters, it is still relatively easy to break. The only unknown that must be determined is the number of places in the alphabet to switch each character. Because there are only 25 possibilities, a routine can be written to quickly run through all feasible combinations and print the results, as follows:
DBEMUC | KXN | FORSMVOC | GSDR | DBKSVOBC | ECO | BSQRD | VKXO |
ECFNVD | LYO | GPSTNWPD | HTES | ECLTWPCD | FDP | CTRSE | WLYP |
FDGOWE | MZP | HQTUOXQE | IUFT | FDMUXQDE | GEQ | DUSTF | XMZQ |
GEHPXF | NAQ | IRUVPYRF | JVGU | GENVYREF | HFR | EVTUG | YNAR |
HFIQYG | OBR | JSVWQZSG | KWHV | HFOWZSFG | IGS | FWUVH | ZOBS |
IGJRZH | PCS | KTWXRATH | LXIW | IGPXATGH | JHT | GXVWI | APCT |
JHKSAI | QDT | LUXYSBUI | MYJX | JHQYBUHI | KIU | HYWXJ | BQDU |
KILTBJ | REU | MVYZTCVJ | NZKY | KIRZCVIJ | LJV | IZXYK | CREV |
LJMUCK | SFV | NWZAUDWK | OALZ | LJSADWJK | MKW | JAYZL | DSFW |
MKNVDL | TGW | OXABVEXL | PBMA | MKTBEXKL | NLX | KBZAM | ETGX |
NLOWEM | UHX | PYBCWFYM | QCNB | NLUCFYLM | OMY | LCABN | FUHY |
OMPXFN | VIY | QZCDXGZN | RDOC | OMVDGZMN | PNZ | MDBCO | GVIZ |
PNQYGO | WJZ | RADEYHAO | SEPD | PNWEHANO | QOA | NECDP | HWJA |
QORZHP | XKA | SBEFZIBP | TFQE | QOXFIBOP | RPB | OFDEQ | IXKB |
RPSAIQ | YLB | TCFGAJCQ | UGRF | RPYGJCPQ | SQC | PGEFR | JYLC |
SQTBJR | ZMC | UDGHBKDR | VHSG | SQZHKDQR | TRD | QHFGS | KZMD |
TRUCKS | AND | VEHICLES | WITH | TRAILERS | USE | RIGHT | LANE |
USVDLT | BOE | WFIJDMFT | XJUI | USBJMFST | VTF | SJHIU | MBOF |
VTWEMU | CPF | XGJKENGU | YKVJ | VTCKNGTU | WUG | TKIJV | NCPG |
WUXFNV | DQG | YHKLFOHV | ZLWK | WUDLOHUV | XVH | ULJKW | ODQH |
XVYGOW | ERH | ZILMGPIW | AMXL | XVEMPIVW | YWI | VMKLX | PERI |
YWZHPX | FSI | AJMNHQJX | BNYM | YWFNQJWX | ZXJ | WNLMY | QFSJ |
ZXAIQY | GTJ | BKNOIRKY | COZN | ZXGORKXY | AYK | XOMNZ | RGTK |
AYBJRZ | HUK | CLOPJSLZ | DPAO | AYHPSLYZ | BZL | YPNOA | SHUL |
BZCKSA | IVL | DMPQKTMA | EQBP | BZIQTMZA | CAM | ZQOPB | TIVM |
CADLTB | JWM | ENQRLUNB | FRCQ | CAJRUNAB | DBN | ARPQC | UJWN |
Running such a routine quickly reveals the correct translation of the code, as it is the only sentence that is readable of the lot.
Previous | Table of Contents | Next |