Copyright
Library of Congress Cataloging-in-Publication Data
Thorsteinson, Peter.
.NET security and cryptography / Peter Thorsteinson and Arun Ganesh.
p. cm.
Includes bibliographical references and index.
ISBN 0-131-00851-X (alk. paper)
1. Computer security. 2. Cryptography. 3. Microsoft .NET. I. Ganesh, Arun. II. Title.
QA76.9.A25T48 2003
005.8dc21 2003051438
Editorial/Production Supervision: Jacquelyn Doucette
Acquisitions Editor: Karen Gettman
Marketing Manager: Curt Johnson
Manufacturing Buyer: Carol Melville
Cover Design: Anthony Gemallaro
Cover Design Direction: Jerry Votta
Interior Series Design: Gail Cocker-Bogusz
2004 Pearson Education, Inc.
Publishing as Prentice Hall Professional Technical Reference
Upper Saddle River, NJ 07458
Prentice Hall books are widely used by corporations and government agencies for training, marketing, and resale.
The publisher offers discounts on this book when ordered in bulk quantities. For more information, contact Corporate Sales Department, phone: 800-382-3419; fax: 201-236-7141; email: . Or write Corporate Sales Department, Prentice Hall PTR, One Lake Street, Upper Saddle River, NJ 07458.
Product and company names mentioned herein are the trademarks or registered trademarks of their respective owners.
All rights reserved. No part of this book may be reproduced, in any form or by any means, without permission in writing from the publisher.
Printed in the United States of America
10 9 8 7 6 5 4 3 2 1
Pearson Education LTD.
Pearson Education Australia PTY, Limited
Pearson Education Singapore, Pte. Ltd.
Pearson Education North Asia Ltd.
Pearson Education Canada, Ltd.
Pearson Educacin de Mexico, S.A. de C.V.
Pearson EducationJapan
Pearson Education Malaysia, Pte. Ltd.
Integrated .NET Series from Object Innovations and Prentice Hall PTR
C#
INTEROPERABILITY AND MIGRATION
The .NET and COM Interoperability Handbook
Gordon
Migrating to .NET: A Pragmatic Path to VB.NET, Visual C++.NET, and ASP.NET
Katre/Halari/Surapaneni/Gupta/Deshpande
PERL
VISUAL BASIC
VISUAL C++
.NET APPLICATIONS AND TECHNOLOGY
Fundamentals of Web Applications Using .NET and XML
Bell/Feng/Soong/Zhang/Zhu
.NET Security and Cryptography
Thorsteinson/Ganesh
Preface
Over the last several years, security and cryptography technologies have been continually increasing in importance to Windows users and software developers. Additionally, in some respects the security and cryptographic capabilities of 32-bit Windows has reached parity with larger mini and mainframe computing platforms, where security has always been a major priority. Now, with the advent of .NET, these security capabilities have become much easier to implement than ever before. Of course, a significant investment in effort is still required in understanding the concepts and acquiring the skills necessary to leverage the many security features provided by .NET. Indeed, that is exactly what this book is all about. Although much of the same functionality was provided in the form of an arcane Win32 C Windows library, the advent of .NET has made security and cryptography programming much simpler and much more powerful than ever before. The .NET Security Framework provides a powerful set of security and cryptographic classes that are relatively easy to use, and this framework is explored throughout this book.
This book is intended to provide a practical and comprehensive coverage on implementing both cryptography and security functionality on the .NET platform. It is an effective tutorial, providing a large number of clear and focused code examples.
Organization
The book is organized into 10 chapters and five appendixes. introduces .NET Web Services security programming.
Each aspect of .NET cryptography and security is dealt with in the proper context and sequence, where they are most relevant and most easily understood. Appendixes describe a few additional topics, such as security attacks and additional cryptography-related mathematical topics.
This book is intended to be a practical tutorial with many succinct programming examples that focus on specific and individual concepts. Also, the focus of the book is on practical .NET security programming rather than on administrative security tasks. This book provides sufficient background information to enable the reader to clearly see why security and cryptography are critically important to modern software development. The goal is to equip the reader to begin building significant applications using the .NET Security Framework. This book is part of The Integrated .NET Series from Object Innovations and Prentice Hall PTR.
Sample Programs
The best way to learn about a significant class library such as the .NET Security Framework is to read and write many programs. This book provides many small programs that illustrate each of the pertinent features of .NET in isolation, which makes them easier to understand. The programs are clearly labeled in the text, and they can all be found in the software distribution that accompanies this book. These sample programs are provided in a self-extracting file on the book's Web site. When expanded, a directory structure is created whose default root is c:\OI\NetSecurity . The sample programs, which begin with the second chapter, are in directories Chap02, Chap03 , and so on. All the samples for a given chapter are in individual folders within the chapter directories. The names of the folders are clearly identified in the text.
This book is part of The Integrated .NET Series. The sample programs for other books in the series are located in their own directories underneath \OI , so all the .NET examples from all books in the series will be located in a common area as you install them. These programs are furnished solely for instructional purposes and should not be embedded in any software product. The software (including instructions for use) is provided as is without warranty of any kind.
Web Site
The Web site for the book series is located at http://www.objectinnovations.com/dotnet.htm.
A link is provided at that Web site for downloading the sample programs for this book.
Acknowledgments
Peter Thorsteinson
We would like to thank Jill Harry from Prentice Hall for her support in starting this project. Also, we would like to thank the series editor, Robert Oberg, for his valuable help.
G. Gnana Arun Ganesh
I would like to thank my parents G.A. Gnanavel and G.N. Vadivambal for their boundless love, patience, support and inspiration. Also I thank my sister G.G. Saradha for her love, tenderness and companionship. My deepest gratitude goes to my well wisher Dr. Robert J. Oberg who has encouraged me through out this exciting project. My special thanks go out to Mr. Anindo Dey, Mr. Narayana Rao Surapaneni and Mr. Vinod Kumar for their motivation and encouragement. I wish to thank my co-author Peter Thorsteinson for his guidance and assistance. Finally let me thank the Almighty for providing me this opportunity.