Click here to Skip to main content
15,891,529 members
Articles / Web Development / ASP.NET

Encryption/Decryption with .NET

Rate me:
Please Sign up or sign in to vote.
3.00/5 (31 votes)
14 Mar 2002 448K   5K   90  
A .NET SymmetricAlgorithm security class wrapper for in memory encryption/decryption with a private key
<%@ Page language="c#" AutoEventWireup="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>WebForm1</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio 7.0">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<DIV style="Z-INDEX: 101; LEFT: 21px; WIDTH: 714px; POSITION: absolute; TOP: 22px; HEIGHT: 303px" ms_positioning="FlowLayout">
				<H3><A class="LINK" name="2a"></A><FONT color="navy">Encryption and Decryption </FONT>
				</H3>
				<P><FONT color="navy">The <B>System.Security.Cryptographic </B>namespace within the 
						Microsoft .NET Framework provides a variety of tools to aid in encryption and 
						decryption. The <B>CryptoStream </B>class is used here to demonstrate the 
						encryption and decryption with <STRONG>System.Security.Cryptographic.SymmetricAlgorithm</STRONG>, 
						such as <STRONG>DESCryptoServiceProvider, RC2CryptoServiceProvider, </STRONG>and
						<STRONG>RijndaelManaged </STRONG>classes.</FONT></P>
				<P><FONT color="navy">I have searched the Internet for some samples and all I found 
						were based on the Microsoft sample code ( </FONT><A href="http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q307010">
						<FONT color="navy">http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q307010</FONT></A><FONT color="navy">&nbsp;) 
						which basically uses input/output files as source and destination.&nbsp; I 
						would like to have the encryption and decryption done in memory without having 
						to specify source and destintion files, so that I could use the code on a web 
						server or so.</FONT></P>
				<P><FONT color="navy">If you have any questions, please email to: </FONT><A href="mailto:fangfrank@hotmail.com">
						<FONT color="navy">fangfrank@hotmail.com</FONT></A></P>
				<P><FONT color="navy">Frank Fang</FONT></P>
				<P>&nbsp;</P>
			</DIV>
			<asp:HyperLink id="HyperLink1" style="Z-INDEX: 102; LEFT: 222px; POSITION: absolute; TOP: 372px" runat="server" NavigateUrl="crypto.asmx">Demon</asp:HyperLink>
			<asp:HyperLink id="hlnkSource" style="Z-INDEX: 103; LEFT: 385px; POSITION: absolute; TOP: 373px" runat="server" NavigateUrl="SymmCrypto.htm">Source Code</asp:HyperLink>
		</form>
	</body>
</HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions