📄 12-05.html
字号:
<HTML>
<HEAD>
<META name=vscategory content="Security Programming Languages"><META name=vsisbn content="0471128457"><META name=vstitle content="Applied Cryptography, Second Edition: Protocols, Algorthms, and Source Code in C (cloth)"><META name=vsauthor content="Bruce Schneier"><META name=vsimprint content="Wiley Computer Publishing "><META name=vspublisher content="John Wiley & Sons, Inc."><META name=vspubdate content="1/1/96"><TITLE>APPLIED CRYPTOGRAPHY, SECOND EDITION: Protocols, Algorithms, and Source Code in C:Data Encryption Standard (DES)</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"> <table width="640" border="0" cellpadding="0" cellspacing="0"> <tr valign="top"> <td><!-- Begin Ads ITKBAN.BOOKS //-->
<HTML>
<head>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
function jumpurl(form)
{
location = form.URL.options[form.URL.selectedIndex].value;
return true;
};
//-->
</SCRIPT>
</head>
<BODY>
<TABLE width=468 height=60>
<TR>
<TD>
<TABLE>
<TR>
<TD><IMG SRC="http://adimages.earthweb.com/images/ads/house/dtm_salary/dtm_html.gif" BORDER=0 WIDTH=332 HEIGHT=60></TD>
<TD width=168 height=60 align=center valign=bottom><font face="verdana,
helvetica" size=1>
<FORM ACTION="">
<SELECT NAME="URL" SIZE="1" onchange="jumpurl(this.form);">
<OPTION VALUE="/adclick.html/CID=00000bff33d6f71200000000/site=itknowledge/area=itk.books/aamsz=468x60?1,1">Basic</OPTION>
<!-- http://www.datamation.com/staff/survey/bylang_basic.html -->
<OPTION VALUE="/adclick.html/CID=00000bff33d6f71200000000/site=itknowledge/area=itk.books/aamsz=468x60?1,2">C/C++</OPTION>
<!-- http://www.datamation.com/staff/survey/bylang_c.html -->
<OPTION VALUE="/adclick.html/CID=00000bff33d6f71200000000/site=itknowledge/area=itk.books/aamsz=468x60?1,3">HTML</OPTION>
<!-- http://www.datamation.com/staff/survey/bylang_html.html -->
<OPTION VALUE="/adclick.html/CID=00000bff33d6f71200000000/site=itknowledge/area=itk.books/aamsz=468x60?1,4">Java</OPTION>
<!-- http://www.datamation.com/staff/survey/bylang_java.html -->
<OPTION VALUE="/adclick.html/CID=00000bff33d6f71200000000/site=itknowledge/area=itk.books/aamsz=468x60?1,5">SQL</OPTION>
<!-- http://www.datamation.com/staff/survey/bylang_sql.html -->
</SELECT>
<A HREF="/adclick.html/CID=00000bff33d6f71200000000/site=itknowledge/area=itk.books/aamsz=468x60?1,6" TARGET="_blank"><font face="verdana,helvetica" size=2>GO</A>
<!-- http://www.datamation.com/index.html -->
</FORM>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<!-- ITKBAN.BOOKS End Ads //--></td> <td><!-- Begin Ads ITKBAN //--><CENTER><A HREF="/adclick.html/CID=00000b452954e8a400000000/site=itknowledge/area=itk/aamsz=160x60/position=top" TARGET=_top><IMG BORDER=0 SRC="http://adimages.earthweb.com/images/ads/160x60/compaq_dtm_sponsor.gif" ALT="" ></A><BR><A HREF="/adclick.html/CID=00000b452954e8a400000000/site=itknowledge/area=itk/aamsz=160x60/position=top" TARGET=_top></A></CENTER><BR><!-- ITKBAN End Ads //--></td> </tr> <tr><td height="1" colspan="2" bgcolor="#CCCCCC"><img src="/images/white.gif" border=0 alt=""></td></tr> </TABLE><!-- END HEADER --><!-- BEGIN SUB HEADER --> <table bgcolor="#FFFFFF" cellpadding="0" cellspacing="0" border="0" width="100%"> <!-- ITK LOGO Banner --> <tr> <td align="left" valign="top" bgcolor="#FFFFFF"><script>function GetCookie (name){ var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) { var end = document.cookie.indexOf (";", j); if (end == -1) end = document.cookie.length; return unescape(document.cookie.substring(j, end)); } i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null;}var m1='<IMG SRC="';var m2='/images/itk-logo.gif';var m3='" VSPACE="10" WIDTH=434 HEIGHT=58 ALT="ITKnowledge" border="0">';var gifstr=GetCookie("UsrType");if((gifstr!=0 ) && (gifstr!=null)) { m2=gifstr; }document.write(m1+m2+m3);</script></td> </tr><!-- END of ITK LOGO Banner --> <!-- ITK TOPNAV --> <tr> <td align="left" valign="top" nowrap><a href="/"><img src="/images/home1.gif" width=38 height=37 alt="home" border="0"></a> <a href="/pick-account.html"><img src="/images/accountinfo.gif" width=70 height=37 alt="account info" border="0"></a> <a href="/PSUser/usrreg.htm?AdminAction=InitAdd&Locale=en&URI=/"><img src="/images/subscribe2.gif" width=56 height=37 alt="subscribe" border="0" hspace="6"></a> <a href="/PSUser/psuserauth.htm?cmd=login&URI=/"><img src="/images/login1.gif" width=33 height=37 alt="login" hspace="5" border="0"></a> <a href="/search/"><img src="/images/search1.gif" width=43 height=37 alt="search" border="0" hspace="10"></a> <a href="/faq/faq.html"><img src="/images/faqs1.gif" width=40 height=37 alt="FAQ/help" border="0" hspace="0"></a> <a href="/sitemap.html"><img src="/images/sitemap1.gif" width=46 height=37 alt="site map" border="0" hspace="2"></a> <a href="/contactus.html"><img src="/images/contact1.gif" width=61 height=37 alt="contact us" border="0" hspace="4"></a><br> <img src="/images/white.gif" width="1" height="5" alt="" border="0"></td> </tr></table><!-- END of ITK TOPNAV --> <!-- begin of ITK left NAV --><!-- BEGIN LEFT NAV --> <table width=99% border="0" cellpadding="2" cellspacing="0"> <tr> <td bgcolor="#ffffff" width=120 valign="top" rowspan=8> <form name="Search" method="GET" action="http://search.earthweb.com/search97/search_redir.cgi"> <INPUT TYPE="hidden" NAME="Action" VALUE="Search"> <INPUT TYPE="hidden" NAME="SearchPage" VALUE="http://search.earthweb.com/search97/samples/forms/srchdemo.htm"> <INPUT TYPE="hidden" NAME="Collection" VALUE="ITK"> <INPUT TYPE="hidden" NAME="ViewTemplate" VALUE="view.hts"> <img src="/images/search5.gif" width=115 height=27 alt="" border="0"><br> <img src="/images/white.gif" width="1" height="5" alt="" border="0"><br> <table width="116" height="135" bgcolor="#e0e0e0" border="1" bordercolor="#006666" cellpadding="3" cellspacing="0"> <tr> <td width="116"><input type="text" name="metaqueryText" value="" size="8"> <input type="submit" name="submitbutton" value="Go!"> <INPUT type="hidden" NAME="section_on" VALUE="on"> <font face="Arial,helvetica" size="1"> <SELECT NAME="metatags" style="font-size: 10; font-family: sans-serif;" size="1"> <option value="keyword" SELECTED>Keyword <option value="vstitle">Title <option value="vsauthor">Author <option value="vsisbn">ISBN <option value="vspublisher">Publisher <option value="vsimprint">Imprint </SELECT></font><br> <input type="radio" name="ResultTemplate" value="itk-brief.hts" checked style="background-color: #e0e0e0;"><font face="arial, helvetica" color="#006666" size="1">Brief</font> <input type="radio" name="ResultTemplate" value="itk-full.hts" style="background-color: #e0e0e0;"><font face="arial, helvetica" color="#006666" size="1">Full</font><br> <font face="arial, helvetica" size="1"> <img src="/images/bullet.gif" width=5 height=5 hspace="5" alt="" border="0"> <a href="/search/"><font color="#006666">Advanced</font></a><br> <a href="/search/"><font color="#006666">Search</font></a><br> <img src="/images/bullet.gif" width=5 height=5 hspace="5" alt="" border="0"> <a href="/search/search-tips.html"><font color="#006666">Search Tips</font></a> </font></td></tr></table> </form><!-- BROWSE BY TOPIC --> <form action="" name="catlist"> <img src="/images/browse5.gif" width=115 height=34 alt="" border="0"><table width="120" height="32" border="1" cellspacing="0" cellpadding="3" bordercolor="#006666" bgcolor="#e0e0e0"> <tr> <td width="117" align="center"> <font face="Arial,helvetica" size="1"> <SELECT NAME="cat" onChange='top.location.href=this.options[selectedIndex].value;' style="font-size: 10; font-family: sans-serif;"> <option value="" selected>Please Select <option value="">----------- <option value="/reference/dir.components.html">Components <option value="/reference/dir.contentmanagement.html">Content Mgt <option value="/reference/dir.certification1.html">Certification <option value="/reference/dir.databases.html">Databases <option value="/reference/dir.enterprisemanagement1.html">Enterprise Mgt <option value="/reference/dir.funandgames1.html">Fun/Games <option value="/reference/dir.groupwareandcollaboration1.html">Groupware <option value="/reference/dir.hardware1.html">Hardware <option value="/reference/dir.intranetandextranetdevelopment1.html">Intranet Dev <option value="/reference/dir.middleware.html">Middleware <option value="/reference/dir.multimediaandgraphicdesign1.html">Multimedia <option value="/reference/dir.networkservices1.html">Networks <option value="/reference/dir.operatingsystems.html">OS <option value="/reference/dir.productivityapplications1.html">Prod Apps <option value="/reference/dir.programminglanguages.html">Programming <option value="/reference/dir.security1.html">Security <!-- <option value="/reference/dir.ewtraining1.html">Training Guides --> <option value="/reference/dir.userinterfaces.html">UI <option value="/reference/dir.webservices.html">Web Services <option value="/reference/dir.webmasterskills1.html">Webmaster <option value="/reference/dir.y2k1.html">Y2K <option value="">----------- <option value="/reference/whatsnew.html">New Titles <option value="">----------- <option value="/reference/dir.archive1.html">Free Archive </SELECT> </font></td> </tr> </table> </form><!-- LEFT NAV SEARCH END --> </td> <!-- PUB PARTNERS END --><!-- END LEFT NAV --><td rowspan="8" align="right" valign="top"><img src="/images/iswbls.gif" width=1 height=400 alt="" border="0"></td><td><img src="/images/white.gif" width="5" height="1" alt="" border="0"></td><!-- end of ITK left NAV --><!-- begin main content --><td width="100%" valign="top" align="left"><!-- END SUB HEADER -->
<!--Begin Content Column -->
<FONT FACE="Arial,Helvetica" SIZE="-1">
To access the contents, click the chapter and section titles.
</FONT>
<P>
<B>Applied Cryptography, Second Edition: Protocols, Algorthms, and Source Code in C (cloth)</B>
<FONT SIZE="-1">
<BR>
<I>(Publisher: John Wiley & Sons, Inc.)</I>
<BR>
Author(s): Bruce Schneier
<BR>
ISBN: 0471128457
<BR>
Publication Date: 01/01/96
</FONT>
<P>
<form name="Search" method="GET" action="http://search.earthweb.com/search97/search_redir.cgi">
<INPUT TYPE="hidden" NAME="Action" VALUE="Search">
<INPUT TYPE="hidden" NAME="SearchPage" VALUE="http://search.earthweb.com/search97/samples/forms/srchdemo.htm">
<INPUT TYPE="hidden" NAME="Collection" VALUE="ITK">
<INPUT TYPE="hidden" NAME="ResultTemplate" VALUE="itk-full.hts">
<INPUT TYPE="hidden" NAME="ViewTemplate" VALUE="view.hts">
<font face="arial, helvetica" size=2><b>Search this book:</b></font><br>
<INPUT NAME="queryText" size=50 VALUE=""> <input type="submit" name="submitbutton" value="Go!">
<INPUT type=hidden NAME="section_on" VALUE="on">
<INPUT type=hidden NAME="section" VALUE="http://www.itknowledge.com/reference/standard/0471128457/">
</form>
<!-- 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=12//-->
<!--PAGES=274-276//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="12-04.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="12-06.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<P><FONT SIZE="+1"><B><I>The S-Box Substitution</I></B></FONT></P>
<P>After the compressed key is XORed with the expanded block, the 48-bit result moves to a substitution operation. The substitutions are performed by eight <B>substitution boxes,</B> or <B>S-boxes</B>. Each S-box has a 6-bit input and a 4-bit output, and there are eight different S-boxes. (The total memory requirement for the eight DES S-boxes is 256 bytes.) The 48 bits are divided into eight 6-bit sub-blocks. Each separate block is operated on by a separate S-box: The first block is operated on by S-box 1, the second block is operated on by S-box 2, and so on. See Figure 12.4.</P>
<P>Each S-box is a table of 4 rows and 16 columns. Each entry in the box is a 4-bit number. The 6 input bits of the S-box specify under which row and column number to look for the output. Table 12.6 shows all eight S-boxes.</P>
<P>The input bits specify an entry in the S-box in a very particular manner. Consider an S-box input of 6 bits, labeled <I>b</I><SUB>1</SUB> <I>b</I><SUB>2</SUB> <I>b</I><SUB>3</SUB> <I>b</I><SUB>4</SUB> <I>b</I><SUB>5</SUB> and <I>b</I><SUB>6</SUB>. Bits <I>b</I><SUB>1</SUB> and <I>b</I><SUB>6</SUB> are combined to form a 2-bit number, from 0 to 3, which corresponds to a row in the table. The middle 4 bits, <I>b</I><SUB>2</SUB> through <I>b</I><SUB>5</SUB> are combined to form a 4-bit number, from 0 to 15, which corresponds to a column in the table.</P>
<P>For example, assume that the input to the sixth S-box (i.e., bits 31 through 36 of the XOR function) is 110011. The first and last bits combine to form 11, which corresponds to row 3 of the sixth S-box. The middle 4 bits combine to form 1001, which corresponds to the column 9 of the same S-box. The entry under row 3, column 9 of S-box 6 is 14. (Remember to count rows and columns from 0 and not from 1.) The value 1110 is substituted for 110011.</P>
<I><P><A NAME="Fig3"></A><A HREF="javascript:displayWindow('images/12-03.jpg',317,151 )"><IMG SRC="images/12-03t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/12-03.jpg',317,151)"><FONT COLOR="#000077"><B>Figure 12.3</B></FONT></A> Expansion permutation.</I>
</P>
<TABLE WIDTH="100%">
<TR>
<TH CAPTION COLSPAN="12" ALIGN="CENTER">Table 12.5<BR>Expansion Permutation
<TR>
<TD COLSPAN="12"><HR>
<TR>
<TD WIDTH="8%" VALIGN="TOP" ALIGN="RIGHT">32,
<TD WIDTH="8%" VALIGN="TOP" ALIGN="RIGHT">1,
<TD WIDTH="8%" VALIGN="TOP" ALIGN="RIGHT">2,
<TD WIDTH="8%" VALIGN="TOP" ALIGN="RIGHT">3,
<TD WIDTH="8%" VALIGN="TOP" ALIGN="RIGHT">4,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -