Encrypting a File Using .NET

Our "Tacit Records" columnist shows you how .NET's cryptographic support works using the Cryptostream class, which you can implement within either C# or Visual Basic. Here's how to get started.

provided by: 
Originally published at Internet.com


Part of .NET's security framework is cryptographic support, and the System.Security.Cryptography namespace is the library that supports cryptographic operations. This namespace supports encryption, digital signatures, random number generations, hashing, and secure encoding and decoding. It implements these operations using common cryptographic algorithms, namely RSA, DSA, Rijandel, Triple DES, RC2, MD5, and the SHA family (SHA1, 256, 384, and 512).

Tom Gutschmidt

One class within System.Security.Cryptography, CryptoStream, is provided to encrypt or decrypt content as it is streamed out into a file. Cryptostream defines a stream that links data to cryptographic transformations. Microsoft provides full code versions for implementing CryptoStream within C# or Visual Basic. Following their examples, encrypting a file using CryptoStream is straightforward.

First the System.Security.Cryptography needs to be included, and then a key for encryption or decryption needs to be created or declared. The key must be a constant, and contained within a class or module. There are also other restrictions based on which algorithm is being used...

Read article at Internet.com site
Regional Articles
- Encrypting a File Using .NET Alabama
- Encrypting a File Using .NET Alaska
- Encrypting a File Using .NET Arizona
- Encrypting a File Using .NET Arkansas
- Encrypting a File Using .NET California
- Encrypting a File Using .NET Colorado
- Encrypting a File Using .NET Connecticut
- Encrypting a File Using .NET DC
- Encrypting a File Using .NET Delaware
- Encrypting a File Using .NET Florida
- Encrypting a File Using .NET Georgia
- Encrypting a File Using .NET Hawaii
- Encrypting a File Using .NET Idaho
- Encrypting a File Using .NET Illinois
- Encrypting a File Using .NET Indiana
- Encrypting a File Using .NET Iowa
- Encrypting a File Using .NET Kansas
- Encrypting a File Using .NET Kentucky
- Encrypting a File Using .NET Louisiana
- Encrypting a File Using .NET Maine
- Encrypting a File Using .NET Maryland
- Encrypting a File Using .NET Massachusetts
- Encrypting a File Using .NET Michigan
- Encrypting a File Using .NET Minnesota
- Encrypting a File Using .NET Mississippi
- Encrypting a File Using .NET Missouri
- Encrypting a File Using .NET Montana
- Encrypting a File Using .NET Nebraska
- Encrypting a File Using .NET Nevada
- Encrypting a File Using .NET New Hampshire
- Encrypting a File Using .NET New Jersey
- Encrypting a File Using .NET New Mexico
- Encrypting a File Using .NET New York
- Encrypting a File Using .NET North Carolina
- Encrypting a File Using .NET North Dakota
- Encrypting a File Using .NET Ohio
- Encrypting a File Using .NET Oklahoma
- Encrypting a File Using .NET Oregon
- Encrypting a File Using .NET Pennsylvania
- Encrypting a File Using .NET Rhode Island
- Encrypting a File Using .NET South Carolina
- Encrypting a File Using .NET South Dakota
- Encrypting a File Using .NET Tennessee
- Encrypting a File Using .NET Texas
- Encrypting a File Using .NET Utah
- Encrypting a File Using .NET Vermont
- Encrypting a File Using .NET Virginia
- Encrypting a File Using .NET Washington
- Encrypting a File Using .NET West Virginia
- Encrypting a File Using .NET Wisconsin
- Encrypting a File Using .NET Wyoming

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML