13.

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


Subroutines and Programs

To extend the practical use of encipherment, numerous routines will be developed in this book to perform different enciphering and deciphering related operations. To provide code that can be utilized by a maximum number of readers, program modules are developed using both C++ and QuickBASIC. Concerning the development of C++ modules, this author and his son used the Microsoft Visual C++ compiler to create and execute C++ routines used in this book. Microsoft Corporation’s QuickBASIC compiler was used to develop the QuickBASIC subroutines and programs contained in this book.

The selection of C++ as one of two programming languages to use in the development of programming modules was based upon several factors. First, C++ is a very powerful programming language which provides programmers with the ability to perform data manipulations frequently required when using different encryption algorithms. Secondly, C++ is standardized and compilers are readily available, which means that the modules created by this author using Microsoft’s Visual C++ can be used by persons with C++ compilers developed by other software vendors. However, since it is possible that some persons may not have a C++ compiler, each program module was also coded using QuickBASIC. In addition, program modules created in both C++ and QuickBASIC are stored on the CD-ROM accompanying this book in both source and binary executable form. This will provide you with a significant degree of flexibility as you can elect to incorporate source modules into Visual C++ or Visual Basic to create Windows-compliant programs, execute the binary modules under DOS to experiment with the creation of ciphertext through the use of different encryption techniques, or modify source code to tailor one or more modules to your specific requirements.

QuickBASIC was also selected for several reasons. First and foremost, every version of PC-DOS and MS-DOS contains a BASIC language interpreter on the DOS distribution diskette. This means that most readers can easily adapt the subroutines and programs presented in this book to execute through the use of a BASIC language interpreter at no additional cost. Readers can use the programs as is, modify one or more programs, or select a number of subroutines that can be viewed similar to a construction set for the design of a program tailored to a specific reader requirement.

A second reason for the selection of QuickBASIC is the availability of QBASIC on all DOS distribution diskettes commencing with release 5.0 of that operating system. QBASIC can execute all subroutines and programs presented in this book without modification, facilitating the use of those subroutines and programs.

The large number of persons with BASIC programming knowledge enables more persons to be able to put theory to practice. The capability of the QBASIC compiler to produce object code permits the inclusion of ready-to-run, executable program files on the CD-ROM. This allows you to directly execute a program without having to modify the source code, as would be required if a BASIC interpreter is used. Of course, you cannot modify the executable program, which may take some of the fun out of the use of the program if you would like to attempt to modify one or more functions.

File Naming Conventions

To facilitate the use of the CD-ROM, a set of file naming conventions was developed and used to reference program listings in this book as well as files on the CD-ROM. Files with the extension .CPP represent C++ language source code files. In this book, those files appear as subroutine and program listings. Files with the extension .BAS are BASIC language source code files. In this book, those files also appear as subroutine and program listings. Files with the extension .DAT reference data files. These files contain plaintext and ciphertext messages which facilitate demonstrating the operation and utilization of the programs developed in this book and are also contained on the CD-ROM. The fourth type of file has the extension .EXE. Files with that extension represent executable programs that readers can directly run on any Windows and DOS-based personal computer.

To enable the largest number of potential readers to use this book, files are stored under two directories on the CD-ROM. The C directory contains C++ language source and executable language programs, while the BASIC directory contains BASIC language source and executable programs. Although it is easy to distinguish BASIC and C++ source programs from one another by their extensions, both programs use the extension .EXE for executable programs. Thus, it is important to remember to note the directory under which an executable program is stored as it serves as a mechanism to distinguish BASIC from C++ executable programs. Refer to Appendix A for a list of files contained on the CD, including their names and description. Table 1.6 summarizes the file naming conventions used in this book for the mythical file XXXX.

Table 1.6 File naming conventions

File Name Description

XXXX.BAS The BASIC source code for the program XXXX.
XXXX.CPP The C++ source code for the program XXXX.
XXXX.EXE The BASIC version is in the BASIC directory, and the C++ version is in the C directory.
XXXX.DAT A sample data file.


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