Article · October 008 citations reads 5,930 authors
Download 77.34 Kb. Pdf ko'rish
|
The book cipher algorithm (1) (1)
- Bu sahifa navigatsiya:
- Practical Issues
48
Dr. Dobb’s Journal l www.ddj.com l October 2008 Core Technology THE BOOK CIPHER ALGORITHM guessing probable plaintexts along the ciphertext, attackers will eventually recog- nize the book and break the code. A better idea is to replace words in the plaintext with the location of words from a book. For example, to encode the word “computer,” you look for the first appear- ance of “computer” in the previously cho- sen book and enter its position as the cipher text. The second appearance of the word “computer” is replaced by the posi- tion of the second appearance of that word in the book, and so on. The real problem with this approach is finding the word: If you agree to use David Copperfield as a code book, and then try to encrypt an arti- cle about hash functions, you are unlikely to find all the necessary words. An alternative approach that gets around this problem is to replace individual letters rather than words, in which case the Book cipher is properly a cipher. Figure 2 illustrates the concept. We are encoding a message “DRDOBBS” using the same passage from Harry Potter and the Order of the Phoenix. To code the letter “D,” we look for the first word in the passage starting with “D” (it’s the 6th word, “did”). Then we look for the first word starting with “R” (the 11th word, “rang”), then for the next word starting with “D” (the 16th word, “down”), and so on. The final ciphertext is 6, 11, 16, 17, 2, 10, 15. Decoding is even simpler. We take the ciphertext number-by-number and look for the corresponding words in the book, gener- ating the original plaintext. Practical Issues The Book cipher is straightforward to imple- ment and secure, but using it in real life pres- ents some difficulties. First of all, you can encrypt only letters, preferably after convert- ing them to uppercase. Most of the crypto textbooks deal with uppercase letters only— introducing symbols that appear very often (such as blanks) or sparsely (such as $ or the #) gives attackers an unnecessary advantage. On the other hand, sometimes you have to encode a message containing numbers or special symbols, and reading decoded text without blanks is a real pain. This issue can be resolved by pre- encoding the plaintext using an algorithm sim- ilar to UUENCODE, which produces upper- case letters only. A possible candidate is the Five-Letter Codegroup Filter (www.fourmilab .ch/codegroup). While encoding, you could compress text and even implement some kind of double encryption. Compression is continued from page 46 Download 77.34 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling