<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Security</title><link>http://forums.asp.net/25.aspx</link><description>All about ASP.NET security (authentication, authorization, membership, roles, etc.) and the Login controls. &lt;a href="http://aspadvice.com/SignUp/list.aspx?l=24&amp;c=17" target="_blank"&gt;Email List&lt;/a&gt;</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: RSA Cryptology problem</title><link>http://forums.asp.net/thread/311554.aspx</link><pubDate>Sun, 17 Aug 2003 20:30:19 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:311554</guid><dc:creator>tmw06</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/311554.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=311554</wfw:commentRss><description>Instead of encrypting with keys I would suggest doing a one-way hash using MD5.Create(&amp;quot;somepassword&amp;quot;).  Store the hashed value in your database.  When a user logs on, take the password they entered and has that password and compare it to the hashed value in the database.</description></item><item><title>RSA Cryptology problem</title><link>http://forums.asp.net/thread/310052.aspx</link><pubDate>Fri, 15 Aug 2003 10:57:20 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:310052</guid><dc:creator>mtullock</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/310052.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=25&amp;PostID=310052</wfw:commentRss><description>Hi, I have the following encryption code:
&lt;br /&gt;

&lt;br /&gt;
&lt;pre&gt;
&lt;br /&gt;
    Dim encryptedKey As String = nothing
&lt;br /&gt;
    &amp;lt;WebMethod()&amp;gt; Public Function Encrypt(ByVal password As String) As String
&lt;br /&gt;
        Dim bEncryptedData() As Byte
&lt;br /&gt;
        Dim rsaCSP As RSACryptoServiceProvider
&lt;br /&gt;
        Dim bInput() As Byte
&lt;br /&gt;
        Dim paramCSP As CspParameters
&lt;br /&gt;
        paramCSP = New CspParameters()
&lt;br /&gt;

&lt;br /&gt;
        paramCSP.Flags = CspProviderFlags.UseMachineKeyStore
&lt;br /&gt;
        rsaCSP = New RSACryptoServiceProvider(paramCSP)
&lt;br /&gt;

&lt;br /&gt;
        bInput = (New System.Text.UnicodeEncoding()).GetBytes(password)
&lt;br /&gt;

&lt;br /&gt;
        encryptionKey = rsaCSP.ToXmlString(True)
&lt;br /&gt;

&lt;br /&gt;
        bEncryptedData = rsaCSP.Encrypt(bInput, False)
&lt;br /&gt;
        Encrypt = (New System.Text.UnicodeEncoding()).GetString(bEncryptedData).ToString()
&lt;br /&gt;
    End Function
&lt;br /&gt;
&lt;/pre&gt;
&lt;br /&gt;

&lt;br /&gt;
This works great, it generates a key and the pwd which I can then store in our DB, however, what I want to do now is use the existing key from the DB to encrypt another PWD to see if they match -- any idea how I can get the above code to use the encryptedKey string as teh encryption key??? ( I realise there are other password encryption methods but I have been playing with this one for too ling to give up now :) )
&lt;br /&gt;

&lt;br /&gt;
Cheers
&lt;br /&gt;
Magnus</description></item></channel></rss>