<html>
<head>
<TITLE>APPLIED CRYPTOGRAPHY, SECOND EDITION: Protocols, Algorithms, and Source Code in C:Foundations</TITLE>
<!-- BEGIN HEADER -->
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>
<body bgcolor="ffffff" link="#006666" alink="#006666" vlink="#006666">
<P>
<CENTER><B>Applied Cryptography, Second Edition: Protocols, Algorthms, and Source Code in C (cloth)</B>
<FONT SIZE="-2">
<BR>
<I>(Publisher: John Wiley & Sons, Inc.)</I>
<BR>
Author(s): Bruce Schneier
<BR>
ISBN: 0471128457
<BR>
Publication Date: 01/01/96
</FONT></CENTER>
<P>
<!-- Empty Reference Subhead -->
<!--ISBN=0471128457//-->
<!--TITLE=APPLIED CRYPTOGRAPHY, SECOND EDITION: Protocols, Algorithms, and Source Code in C//-->
<!--AUTHOR=Bruce Schneier//-->
<!--PUBLISHER=Wiley Computer Publishing//-->
<!--CHAPTER=01//-->
<!--PAGES=012-015//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="01-04.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="01-06.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><FONT SIZE="+1"><B><I>Transposition Ciphers</I></B></FONT></P>
<P>In a <B>transposition cipher</B> the plaintext remains the same, but the order of characters is shuffled around. In a <B>simple columnar transposition cipher</B>, the plaintext is written horizontally onto a piece of graph paper of fixed width and the ciphertext is read off vertically (see Figure 1.4). Decryption is a matter of writing the ciphertext vertically onto a piece of graph paper of identical width and then reading the plaintext off horizontally.</P>
<P>Cryptanalysis of these ciphers is discussed in [587,1475]. Since the letters of the ciphertext are the same as those of the plaintext, a frequency analysis on the ciphertext would reveal that each letter has approximately the same likelihood as in English. This gives a very good clue to a cryptanalyst, who can then use a variety of techniques to determine the right ordering of the letters to obtain the plaintext. Putting the ciphertext through a second transposition cipher greatly enhances security. There are even more complicated transposition ciphers, but computers can break almost all of them.</P>
<P>The German ADFGVX cipher, used during World War I, is a transposition cipher combined with a simple substitution. It was a very complex algorithm for its day but was broken by Georges Painvin, a French cryptanalyst [794].</P>
<P>Although many modern algorithms use transposition, it is troublesome because it requires a lot of memory and sometimes requires messages to be only certain lengths. Substitution is far more common.</P>
<P><FONT SIZE="+1"><B><I>Rotor Machines</I></B></FONT></P>
<P>In the 1920s, various mechanical encryption devices were invented to automate the process of encryption. Most were based on the concept of a <B>rotor</B>, a mechanical wheel wired to perform a general substitution.</P>
<P>A <B>rotor machine</B> has a keyboard and a series of rotors, and implements a version of the Vigenère cipher. Each rotor is an arbitrary permutation of the alphabet, has 26 positions, and performs a simple substitution. For example, a rotor might be wired to substitute “F” for “A,” “U” for “B,” “L” for “C,” and so on. And the output pins of one rotor are connected to the input pins of the next.</P>
<I><P><A NAME="Fig4"></A><A HREF="javascript:displayWindow('images/01-04.jpg',282,89 )"><IMG SRC="images/01-04t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-04.jpg',282,89)"><FONT COLOR="#000077"><B>Figure 1.4</B></FONT></A> Columnar transposition cipher.</I>
</P>
<P>For example, in a 4-rotor machine the first rotor might substitute “F” for “A,” the second might substitute “Y” for “F,” the third might substitute “E” for “Y,” and the fourth might substitute “C” for “E”; “C” would be the output ciphertext. Then some of the rotors shift, so next time the substitutions will be different.
</P>
<P>It is the combination of several rotors and the gears moving them that makes the machine secure. Because the rotors all move at different rates, the period for an n-rotor machine is 26<SUP><I>n</I></SUP>. Some rotor machines can also have a different number of positions on each rotor, further frustrating cryptanalysis.</P>
<P>The best-known rotor device is the Enigma. The Enigma was used by the Germans during World War II. The idea was invented by Arthur Scherbius and Arvid Gerhard Damm in Europe. It was patented in the United States by Arthur Scherbius [1383]. The Germans beefed up the basic design considerably for wartime use.</P>
<P>The German Enigma had three rotors, chosen from a set of five, a plugboard that slightly permuted the plaintext, and a reflecting rotor that caused each rotor to operate on each plaintext letter twice. As complicated as the Enigma was, it was broken during World War II. First, a team of Polish cryptographers broke the German Enigma and explained their attack to the British. The Germans modified their Enigma as the war progressed, and the British continued to cryptanalyze the new versions. For explanations of how rotor ciphers work and how they were broken, see [794,86,448,498,446,880,1315,1587,690]. Two fascinating accounts of how the Enigma was broken are [735,796].</P>
<P><FONT SIZE="+1"><B><I>Further Reading</I></B></FONT></P>
<P>This is not a book about classical cryptography, so I will not dwell further on these subjects. Two excellent precomputer cryptology books are [587,1475]; [448] presents some modern cryptanalysis of cipher machines. Dorothy Denning discusses many of these ciphers in [456] and [880] has some fairly complex mathematical analysis of the same ciphers. Another older cryptography text, which discusses analog cryptography, is [99]. An article that presents a good overview of the subject is [579]. David Kahn’s historical cryptography books are also excellent [794,795,796].
</P>
<H3><A NAME="Heading5"></A><FONT COLOR="#000077">1.4 Simple XOR</FONT></H3>
<P><B>XOR</B> is exclusive-or operation: ‘^’ in C or ⊕ in mathematical notation. It’s a standard operation on bits:</P>
<DL>
<DD>0 ⊕ 0 = 0
<DD>0 ⊕ 1 = 1
<DD>1 ⊕ 0 = 1
<DD>1 ⊕ 1 = 0
</DL>
<P>Also note that:
</P>
<DL>
<DD><I>a</I> ⊕ <I>a</I> = 0
<DD><I>a</I> ⊕ <I>b</I> ⊕ <I>b</I> = <I>a</I>
</DL>
<P>The simple-XOR algorithm is really an embarrassment; it’s nothing more than a Vigenère polyalphabetic cipher. It’s here only because of its prevalence in commercial software packages, at least those in the MS-DOS and Macintosh worlds [1502,1387]. Unfortunately, if a software security program proclaims that it has a “proprietary” encryption algorithm—significantly faster than DES—the odds are that it is some variant of this.
</P>
<!-- CODE //-->
<PRE>
/* Usage: crypto key input_file output_file */
void main (int argc, char *argv[])
{
FILE *fi, *fo;
char *cp;
int c;
if ((cp = argv[1]) && *cp!='\0') {
if ((fi = fopen(argv[2], “rb”)) != NULL) {
if ((fo = fopen(argv[3], “wb”)) != NULL) {
while ((c = getc(fi)) != EOF) {
if (!*cp) cp = argv[1];
c ^= *(cp++);
putc(c,fo);
}
fclose(fo);
}
fclose(fi);
}
}
}
</PRE>
<!-- END CODE //-->
<P>This is a symmetric algorithm. The pla
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
applied_cryptography_second_edition.rar (145个子文件)
01-05.html 12KB
08-06.html 12KB
01-06.html 12KB
08-02.html 11KB
08-03.html 11KB
08-01.html 11KB
07-05.html 11KB
10-03.html 11KB
06-09.html 11KB
01-04.html 11KB
07-02.html 10KB
01-01.html 10KB
07-03.html 10KB
07-06.html 10KB
06-01.html 10KB
05-03.html 10KB
08-04.html 10KB
05-01.html 10KB
06-08.html 10KB
05-05.html 10KB
05-07.html 10KB
05-06.html 10KB
01-03.html 10KB
08-05.html 10KB
06-03.html 9KB
05-08.html 9KB
05-02.html 9KB
10-02.html 9KB
06-07.html 9KB
03-11.html 9KB
07-01.html 9KB
06-04.html 9KB
09-06.html 9KB
05-04.html 9KB
04-07.html 9KB
10-05.html 9KB
09-08.html 9KB
09-07.html 9KB
04-06.html 9KB
09-04.html 9KB
07-04.html 9KB
09-02.html 9KB
03-05.html 9KB
09-05.html 9KB
02-04.html 9KB
02-02.html 9KB
02-03.html 9KB
03-01.html 9KB
04-02.html 9KB
06-06.html 9KB
01-02.html 9KB
02-08.html 9KB
03-08.html 9KB
06-05.html 9KB
10-01.html 9KB
04-05.html 9KB
03-02.html 9KB
03-04.html 8KB
06-02.html 8KB
09-03.html 8KB
05-09.html 8KB
10-04.html 8KB
02-01.html 8KB
02-07.html 8KB
09-01.html 8KB
02-10.html 8KB
02-05.html 8KB
04-03.html 8KB
03-03.html 8KB
04-08.html 8KB
03-09.html 8KB
02-06.html 8KB
04-01.html 8KB
04-04.html 8KB
03-10.html 8KB
02-11.html 8KB
07-07.html 8KB
04-09.html 8KB
10-06.html 8KB
02-09.html 7KB
03-07.html 7KB
03-06.html 7KB
07-08.html 7KB
04-10.html 7KB
04-11.html 7KB
10-07.html 7KB
08-07.html 7KB
09-09.html 7KB
03-12.html 6KB
04-12.html 6KB
03-13.html 6KB
05-01.jpg 31KB
02-01.jpg 27KB
09-11.jpg 23KB
09-09.jpg 22KB
08-02.jpg 22KB
09-03.jpg 16KB
05-01t.jpg 16KB
09-08.jpg 16KB
09-05.jpg 14KB
共 145 条
- 1
- 2
资源评论
BeHarder
- 粉丝: 3
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功