|
Hi,
This is from Chandrakanth.
I am doing Encrypt and Decrypt ther Password.
Regarding Encryption I am saving Password in different format.
I want to decrypt the Password from DataBase.
How can i go for that. Is there any source code means please send me that.
Thanks And Regards
Chandrakanth
Chandrakanth
|
|
|
|
|
You may google about how to encrypt and decrypt in C#. C# encryption and decryption
but I have a few suggestions for you.
1. There should NOT be any decryption for password. [ Encrypted == Encrypted ]
In our projects, we never use the encryption method that can be decrypted. This is for security reason.. If we wanna verify whether a particular password is correct or not, we match the encrypted password from database and the encrypted password that is encrypted from the plain text which is typed by user...
2. Password should not be stored what the user entered.
For example, the user set the password "abc123". then, we append some checksum or something to the password. (e.g. "abc123" + "USR1092" ) then, we encrypt this text and save it in the database.
3. The password should not be sent to the user in plain text format if the user lost the password.
In case the user lost the password and he/she wanna recovery then you should give the user a way to reset the password.. (You should not mail the decrypted password back to the user)
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Michael Sync wrote: There should NOT be any decryption for password.
Yes it's a secure method. Hashing right ? But it always annoys the developers to test the functionality. It annoys user too once they forgot the password. But security point of view, it's the best.
|
|
|
|
|
N a v a n e e t h wrote:
Yes it's a secure method. Hashing right ?
Yeah.
N a v a n e e t h wrote: But it always annoys the developers to test the functionality
haha.. ya..
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Michael Sync wrote: 2. Password should not be stored what the user entered.
For example, the user set the password "abc123". then, we append some checksum or something to the password. (e.g. "abc123" + "USR1092" ) then, we encrypt this text and save it in the database.
I mean, password with salt
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Hi ..Frd....once try this code...this is decryption..
private string Decrypt(string strText, string sDecrKey)
{
byte[] byKey;
byte[] IV = {18, 52, 86, 120, 144, 171, 205, 239};
byte[] inputByteArray;
// inputByteArray.Length = strText.Length;
try
{
byKey = System.Text.Encoding.UTF8.GetBytes(sDecrKey.Substring(0, 8));
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
inputByteArray = Convert.FromBase64String(strText);
MemoryStream ms = new MemoryStream();
CryptoStream cs = new CryptoStream(ms, des.CreateDecryptor(byKey, IV), CryptoStreamMode.Write);
cs.Write(inputByteArray, 0, inputByteArray.Length);
cs.FlushFinalBlock();
System.Text.Encoding encoding = System.Text.Encoding.UTF8;
return encoding.GetString(ms.ToArray());
}
catch (Exception ex)
{
return ex.Message;
}
}
Naik M
|
|
|
|
|
Hi
i want to get list of users of sharepoint and send to them an email.
do any body know about it?
|
|
|
|
|
Do you want to send an email to more than one user?
God is always with you.
|
|
|
|
|
yes. one or more than one. both of them. plz
|
|
|
|
|
Create a mailing list and add emails to that list.
message.To = txtEmail.text
and the server can take the rest of actions.
try this link for more details:
http://www.aspheute.com/english/20000918.asp
Let me know whether it is working for you.
God is always with you.
|
|
|
|
|
Hi Dear
I have 2 problem :
1- in getting list of sharepoint users?
2 sendeng email for them.
ur solution is just solve my secend problem but first i can get the list of sharepoint users.
thanks for ur help.
|
|
|
|
|
I have a requirement to read the view file, please help me out ?
How to access FoxPro .VUE (view file) using asp.net to read the data ?
Kind Regards,
Madhusudan Kushwaha
|
|
|
|
|
please don't double post.
- Regards - JON Life is not measured by the amount of breaths we take, but by the moments that take our breath away.
|
|
|
|
|
I have a requirement to read the view file, please help me out ?
How to access FoxPro .VUE (view file) using asp.net to read the data ?
Kind Regards,
Madhusudan Kushwaha
|
|
|
|
|
Hi,
I have page in which user will fill the data by clicking submit....once he click submit button it goes to the next page and I want when user wants to go back to previous the content of previous page must be clear and he get the message "Page expire".
Regards,
KBM
|
|
|
|
|
ASP.NET 1:
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1)
Response.CacheControl = "no-cache";
Response.Expires = -500;
ASP.NET 2:
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.Cache.SetExpires(DateTime.Now.AddDays(-1)); //or a date much earlier than current time
-----
|
|
|
|
|
I have a Master Page and would like to be able to allow each page pull meta tag keyword and description information from an SQL database. How would I add these to each page, pulling that information from an SQL table?
Matthew Hansel
|
|
|
|
|
A MasterPage still supports code-behind. Add a literal control to the master page and set the text as you would on any other data driven page.
only two letters away from being an asset
|
|
|
|
|
I am still new to this. Could you possibly post a sample piece of code to show how this is done? Thank you.
Matthew Hansel
|
|
|
|
|
<br />
<head runat="server"><br />
<asp:literal runat="server" id="meta"></asp:literal><br />
</head><br />
<br />
protected void SetMetaTag()<br />
{<br />
meta.Text = GetMetaTagsFromDb();<br />
}<br />
only two letters away from being an asset
|
|
|
|
|
My question is this:
I have been able to get a feedback form w/ Captcha working and redirecting to a page after successful completion; now I need to send the information gathered in the form to an email address. How can I get this to happen?
Thanks for your help!
----- feedback.aspx.cs -----
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void OnSuccess()
{
Response.Redirect("http://www.talligewi62.org");
captcha.Visible = false;
}
protected void OnFailure()
{
captcha.Message = "The text you entered was not correct. Please try again:";
}
}
----- End of File -----
|
|
|
|
|
google?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yes; but where do I put it in the file?
|
|
|
|
|
nickabradley wrote: where do I put it in the file?
Which file are you talking about?
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
Here is a copy of my feedback.aspx.cs file...
--- feedback.aspx.cs ---
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Cache.SetCacheability(HttpCacheability.NoCache);
}
protected void OnSuccess()
{
Response.Redirect("http://www.talligewi62.org");
captcha.Visible = false;
}
protected void OnFailure()
{
captcha.Message = "The text you entered was not correct. Please try again:";
}
}
--- End of File ---
I believe that the below bit of code will allow me to send the form info back to me in a email (I’m not sure), and I think it would go somewhere in the OnSuccess section of the feedback.aspx.cs file; I just don’t know how to format it to make it work. After they complete the form I need it to send the info back to me and then redirect them to a different page.
SmtpClient smtpClient = new SmtpClient();
MailMessage message = new MailMessage();
try
{
MailAddress fromAddress = new MailAddress(txtEmail.Text, txtName.Text);
smtpClient.Host = "localhost";
smtpClient.Port = 25;
message.From = fromAddress;
message.To.Add("nickbradley@talligewi62.org");
message.Subject = "Talligewi 62 Website Feedback";
message.Bcc.Add(new MailAddress("winterbanquet@talligewi62.org"));
message.IsBodyHtml = false;
message.Body = txtMessage.Text;
smtpClient.Send(message);
}
|
|
|
|