📄 006-009.html
字号:
<html><head><TITLE>Learn Encryption Techniques with BASIC and C++:Technology and Terminology</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>Learn Encryption Techniques with BASIC and C++</B>
<FONT SIZE="-2">
<BR>
<I>(Publisher: Wordware Publishing, Inc.)</I>
<BR>
Author(s): Gil Held
<BR>
ISBN: 1556225989
<BR>
Publication Date: 10/01/98
</FONT></CENTER>
<P>
<!-- Empty Reference Subhead -->
<!--ISBN=1556225989//-->
<!--TITLE=Learn Encryption Techniques with BASIC and C++//-->
<!--AUTHOR=Gilbert Held//-->
<!--PUBLISHER=Wordware Publishing, Inc.//-->
<!--CHAPTER=1//-->
<!--PAGES=006-009//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="004-006.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="009-011.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H4 ALIGN="LEFT"><A NAME="Heading6"></A><FONT COLOR="#000077">Decipherment</FONT></H4>
<P>The process of converting or restoring ciphertext back into its original plaintext contents is known as decipherment. Figure 1.2 illustrates the decipherment process in a block diagram format. Decipherment (<I>D</I>) can be considered the inverse of the encipherment process, requiring the use of an algorithm which converts ciphertext back into its original plaintext. Decipherment is also controlled by a key (<I>k</I>), which is applied to ciphertext (<I>y</I>) to produce plaintext (<I>x</I>), such that <I>x</I>=<I>D<SUB>k</SUB>(y)</I>.</P>
<P><A NAME="Fig2"></A><A HREF="javascript:displayWindow('images/01-02.jpg',467,201 )"><IMG SRC="images/01-02t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/01-02.jpg',467,201)"><FONT COLOR="#000077"><B>Figure 1.2</B></FONT></A> The decipherment process results in the creation of plaintext (x) by applying a decipherment algorithm (D) controlled by a key (k) against ciphertext (y) so that x=D<SUB>k</SUB>(y).
</P>
<P>You can obtain an appreciation for the decipherment process by deciphering the previously enciphered message. Assuming you have the key BURP and received the message LF DLE RS NUL, you would use modulo 2 subtraction to reconstruct the original plaintext message. Thus, an understanding of the decipherment process requires a brief overview of modulo subtraction.
</P>
<P>Under modulo subtraction, if the minuend is greater than the subtrahend the result is obtained by subtracting the subtrahend from the minuend. If the minuend is less than the subtrahend, you would first add the value of the next base position to the minuend prior to subtracting the subtrahend. For example, under base 10 9-5 is 4, while 5-9 is 6 since a value of 10 is added to the minuend (5) prior to subtracting the subtrahend (9).</P>
<P>Since our previous encipherment was performed using modulo 2 addition, we will use modulo 2 subtraction to perform a decipherment operation. Table 1.3 illustrates the modulo 2 subtraction process for all four possible combinations per bit position.</P>
<TABLE WIDTH="50%"><CAPTION ALIGN=LEFT><B>Table 1.3</B> Modulo 2 Subtraction
<TR>
<TH COLSPAN="4"><HR>
<TR>
<TD WIDTH="25%">0
<TD WIDTH="25%">0
<TD WIDTH="25%">1
<TD WIDTH="25%">1
<TR>
<TD><U>0</U>
<TD><U>1</U>
<TD><U>0</U>
<TD><U>1</U>
<TR>
<TD>0
<TD>1
<TD>1
<TD>0
<TR>
<TD COLSPAN="4"><HR>
</TABLE>
<P>Now that you have an appreciation for modulo 2 subtraction, let’s turn our attention to deciphering the previously enciphered message. If you are the recipient of the message, you would receive the enciphered text LF DLE RS NUL. Assuming you have the key BURP, you would then perform a modulo 2 subtract process to decipher the enciphered text into its original plaintext. This decipherment process is illustrated in Table 1.4.
</P>
<TABLE WIDTH="100%"><CAPTION ALIGN=LEFT><B>Table 1.4</B> Deciphering the message LF DLE RS NUL with the key BURP using modulo 2 subtraction.
<TR>
<TH COLSPAN="5"><HR>
<TR>
<TD WIDTH="25%">Enciphered text
<TD WIDTH="20%" ALIGN="CENTER">LF
<TD WIDTH="20%" ALIGN="CENTER">DLE
<TD WIDTH="20%" ALIGN="CENTER">RS
<TD WIDTH="15%" ALIGN="CENTER">NUL
<TR>
<TD>
<TD ALIGN="CENTER">0001010
<TD ALIGN="CENTER">0010000
<TD ALIGN="CENTER">0011110
<TD ALIGN="CENTER">0000000
<TR>
<TD>8 Key
<TD ALIGN="CENTER">B
<TD ALIGN="CENTER">U
<TD ALIGN="CENTER">R
<TD ALIGN="CENTER">P
<TR>
<TD>
<TD ALIGN="CENTER"><U>1000010</U>
<TD ALIGN="CENTER"><U>1010101</U>
<TD ALIGN="CENTER"><U>1010010</U>
<TD ALIGN="CENTER"><U>1010000</U>
<TR>
<TD>Deciphered text
<TD ALIGN="CENTER">1001000
<TD ALIGN="CENTER">1000101
<TD ALIGN="CENTER">1001100
<TD ALIGN="CENTER">1010000
<TR>
<TD COLSPAN="5"><HR>
</TABLE>
<H4 ALIGN="LEFT"><A NAME="Heading7"></A><FONT COLOR="#000077">Keys and Key Space</FONT></H4>
<P>In examining Figure 1.1 and 1.2, the key—no pun intended—to enciphering and deciphering is the key that controls the operation of the enciphering and deciphering algorithms. Although a person may obtain a copy of an enciphered message and have knowledge of the algorithm used to encipher the message, you must use the correct key to successfully decipher the message. Thus, the number of possible values of a key, referred to as an algorithm’s key space, is an important consideration in selecting an enciphering algorithm. This is because an algorithm with a limited key space is very susceptible to a trial-and-error process in which different keys are applied in an attempt to decipher an intercepted message. For example, if a sequence of nine decimal digits is used to form a key, its key space is 10<SUP>10</SUP>, or 10 billion, key values.</P>
<P>Although it is relatively easy to program a computer to generate a series of 10-digit sequences to use at different times, it is probably not realistic to expect a mortal to remember those sequences. Thus, a tradeoff will occur between key space and practicality if we wish to develop ciphers that can be easily used in a manual process. In addition, from a practical point of view, it is many times easier to remember words or phrases instead of a sequence of digits. Thus, many of the cipher systems discussed in this book are based upon the use of an alphabetic key in the form of a word or phrase. This usually provides an increased retention capability over the use of a sequence of digits. Even if you automate the enciphering process through the use of a program executed on a personal computer, under certain situations you may prefer to use a word or phrase in place of a digit sequence to facilitate the use of the program.</P>
<P>Another reason for using alphabetic or alphanumeric keys instead of a key restricted to digits is the significant increase in the key space afforded by the use of alphabetic or alphanumeric keys. For example, a two-digit key provides 10*10, or 100, unique keys. In comparison, the use of two uppercase or two lowercase alphabetic characters in a key provides 26*26, or 676, unique keys, while the use of two alphanumeric characters in which alphabetic characters are limited to a single case results in 36*36, or 1,296, unique keys.</P><P><BR></P>
<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="004-006.html">Previous</A></TD>
<TD><A HREF="../ewtoc.html">Table of Contents</A></TD>
<TD><A HREF="009-011.html">Next</A></TD>
</TR>
</TABLE>
</CENTER>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -