77.

Learn Encryption Techniques with BASIC and C++
(Publisher: Wordware Publishing, Inc.)
Author(s): Gil Held
ISBN: 1556225989
Publication Date: 10/01/98

Previous Table of Contents Next


Chapter 7
Developing Practical Programs

This chapter will first discuss the utilization of previously developed subroutines and concepts into programs for enciphering and deciphering operations. Because you may prefer to use a ready-to-run set of enciphering and deciphering programs, this chapter also presents an overview of the use of a special pair of programs which are contained on the CD-ROM that accompanies this book.

Module Utilization

In previous chapters in this book I developed a number of subroutines that perform predefined operations. As I developed specific programs, those programs were constructed based upon the use of a number of subroutines that provided us with the ability to perform modular operations and link those operations together. You should consider using the previously developed series of subroutines, as well as coding some of the concepts discussed in this book to modify those subroutines, as a basis for developing programs to encipher and decipher messages to satisfy specific user requirements. For example, you may require the use of an enciphering program that restricts the permissible range of enciphered characters. This restriction may result from the ability of an electronic mail system to only accept a limited character set or another limitation that affects the range of resulting enciphered characters. By tailoring previously developed routines you can create enciphering and deciphering programs to satisfy those requirements. To assist you in reviewing the functions performed by the BASIC language subroutines developed and contained in this book, Table 7.1 summarizes their primary function.

Table 7.1 BASIC language subroutine functionality

Subroutine Function Performed

INITIALIZE This subroutine sets the elements in a string array to the uppercase letters of the alphabet.
FORMCIPHER This subroutine forms a cipher alphabet by using an uppercase shift key character to rotate the plaintext alphabet until the shift key character is on the extreme right.
MSGENCIPHER This subroutine converts plaintext to ciphertext using a simple monoalphabetic substitution.
GROUPBY5 This subroutine prints a space after the display of each group of five enciphered characters.
MSGFILE This subroutine assigns I/O files and accepts either keyboard or file input of messages.
CONVERTSTORE This subroutine reads the contents of a plaintext message from a file, enciphers the message using a monoalphabetic substitution process, and outputs the resulting enciphered message to a file.
PRTOUT This subroutine prints an enciphered message in groups of five characters, placing a space between each group and padding the last group with X’s until it contains five characters.
KEYWORD This subroutine creates a keyword-based mixed alphabet based upon a keyword or keyword phrase.
TRANSPORT This subroutine creates a simple or numeric transposition mixed sequence alphabet.
INTERVAL This subroutine creates an interval extracted mixed alphabet.
MSGDCIPHER This subroutine uses a monoalphabetic substitution process to convert ciphertext to plaintext.
DMSGFILE This subroutine is the reverse of the subroutine MSGFILE with respect to I/O file assignment names as the routine accepts files containing a ciphertext and assigns an output file to store plaintext.
DECIPHER This routine can be considered as the reverse of the subroutine CONVERTSTORE as it converts ciphertext to plaintext.
DPRTOUT This subroutine prints the resulting deciphered message on a line-by-line basis without character groupings.
DCONVERTSTORE This subroutine can be considered as the reverse of the subroutine CONVERTSTORE as it converts ciphertext to plaintext.
RCONVERTSTORE This is the modified version of the subroutine CONVERTSTORE used for random number-based encipherment. The subroutine smooths random numbers to between 0 and 25 for modulo 26 addition to alphabetic plaintext characters to produce enciphered text.
SETUP This subroutine selects a random number seed and location in the seed based upon the ASCII value of the characters in a “secret” code.
RDCONVERTSTORE This is the modified version of the subroutine CONVERTSTORE used for deciphering of messages enciphered through the use of the subroutine RCONVERTSTORE.


Previous Table of Contents Next


Learn Encryption Techniques with Basic and C++
Learn Encryption Techniques with BASIC and C++
ISBN: 1556225989
EAN: 2147483647
Year: 2005
Pages: 92
Authors: Gil Held

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net