Click here to Skip to main content
15,895,011 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: url rewrite in asp.net Pin
VijayVishwakarma6-Nov-08 23:58
VijayVishwakarma6-Nov-08 23:58 
QuestionLoading image in asp.net?? Pin
Karan_TN6-Nov-08 21:02
Karan_TN6-Nov-08 21:02 
AnswerRe: Loading image in asp.net?? Pin
eyeseetee6-Nov-08 22:05
eyeseetee6-Nov-08 22:05 
Questionhow to find age using java script.. Pin
raghvendrapanda6-Nov-08 20:57
raghvendrapanda6-Nov-08 20:57 
AnswerRe: how to find age using java script.. Pin
eyeseetee6-Nov-08 22:06
eyeseetee6-Nov-08 22:06 
QuestionStylesheet problem in asp.net web form Pin
Karan_TN6-Nov-08 20:56
Karan_TN6-Nov-08 20:56 
Questioncan we decrypt MD5 algorithm key to original string Pin
Piyush Vardhan Singh6-Nov-08 20:45
Piyush Vardhan Singh6-Nov-08 20:45 
AnswerRe: can we decrypt MD5 algorithm key to original string Pin
Piyush Vardhan Singh7-Nov-08 0:13
Piyush Vardhan Singh7-Nov-08 0:13 
ANSWER:=Rose | [Rose]


private void button1_Click(object sender, EventArgs e)
{
string sd = EncryptMd5("Piyush Vardhan Singh Rajkumar", "sdf");
MessageBox.Show(sd);
string dd = DecryptMd5(sd, "sdf");
MessageBox.Show(dd);
}

public static string DecryptMd5(string sToOriginal, string sPassKey)
{
try
{
byte[] sPassKeyArray;


byte[] sOriginalArray = Convert.FromBase64String(sToOriginal);



MD5CryptoServiceProvider MD5Hash = new MD5CryptoServiceProvider();

sPassKeyArray = MD5Hash.ComputeHash(UTF8Encoding.UTF8.GetBytes(sPassKey));

MD5Hash.Clear();



TripleDESCryptoServiceProvider tripleDesCsp = new TripleDESCryptoServiceProvider();

tripleDesCsp.Key = sPassKeyArray;

tripleDesCsp.Mode = CipherMode.ECB;

tripleDesCsp.Padding = PaddingMode.PKCS7;



ICryptoTransform cTransform = tripleDesCsp.CreateDecryptor();

byte[] resultArray = cTransform.TransformFinalBlock(sOriginalArray, 0, sOriginalArray.Length);



tripleDesCsp.Clear();



return UTF8Encoding.UTF8.GetString(resultArray);

}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
return null;
}
}



public static string EncryptMd5(string sOriginal, string sPassKey)
{

byte[] sPassKeyArray;

byte[] sOriginalArray = UTF8Encoding.UTF8.GetBytes(sOriginal);



MD5CryptoServiceProvider MD5Hash = new MD5CryptoServiceProvider();

sPassKeyArray = MD5Hash.ComputeHash(UTF8Encoding.UTF8.GetBytes(sPassKey));

MD5Hash.Clear();



TripleDESCryptoServiceProvider tripleDesCsp = new TripleDESCryptoServiceProvider();

tripleDesCsp.Key = sPassKeyArray;

tripleDesCsp.Mode = CipherMode.ECB;

tripleDesCsp.Padding = PaddingMode.PKCS7;



ICryptoTransform cTransform = tripleDesCsp.CreateEncryptor();

byte[] resultArray = cTransform.TransformFinalBlock(sOriginalArray, 0, sOriginalArray.Length);



tripleDesCsp.Clear();



return Convert.ToBase64String(resultArray, 0, resultArray.Length);

}

Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com



QuestionSurvey kind of program in "Previous" & "Next" fashion [modified] Pin
LiYS6-Nov-08 20:40
LiYS6-Nov-08 20:40 
QuestionPoxy settings in the Application centre test Pin
sarada1236-Nov-08 20:22
sarada1236-Nov-08 20:22 
QuestionSending auto Email with attachment Pin
sachees1236-Nov-08 19:21
sachees1236-Nov-08 19:21 
Questionhow to Write Javascript Code for Dropdown Change in Asp.net 2.0 Pin
MallikarjunaGupta6-Nov-08 19:07
MallikarjunaGupta6-Nov-08 19:07 
AnswerRe: how to Write Javascript Code for Dropdown Change in Asp.net 2.0 Pin
Sandeep Akhare6-Nov-08 19:19
Sandeep Akhare6-Nov-08 19:19 
QuestionUserControl in asp.net Pin
RohiniTalks6-Nov-08 19:05
RohiniTalks6-Nov-08 19:05 
AnswerRe: UserControl in asp.net Pin
Sandeep Akhare6-Nov-08 19:16
Sandeep Akhare6-Nov-08 19:16 
GeneralRe: UserControl in asp.net Pin
RohiniTalks6-Nov-08 19:25
RohiniTalks6-Nov-08 19:25 
GeneralRe: UserControl in asp.net Pin
Sandeep Akhare6-Nov-08 19:32
Sandeep Akhare6-Nov-08 19:32 
QuestionDisplay Session Variable in HTML Text Pin
Arcdigital6-Nov-08 16:13
Arcdigital6-Nov-08 16:13 
AnswerRe: Display Session Variable in HTML Text Pin
Kannan Ar6-Nov-08 17:47
professionalKannan Ar6-Nov-08 17:47 
GeneralRe: Display Session Variable in HTML Text Pin
Arcdigital7-Nov-08 1:12
Arcdigital7-Nov-08 1:12 
QuestionHow to fire the target button(in a content page) when I press "Enter" key Pin
cwjcyberfox6-Nov-08 15:51
cwjcyberfox6-Nov-08 15:51 
AnswerRe: How to fire the target button(in a content page) when I press "Enter" key Pin
Sandeep Akhare6-Nov-08 19:25
Sandeep Akhare6-Nov-08 19:25 
GeneralRe: How to fire the target button(in a content page) when I press "Enter" key Pin
cwjcyberfox6-Nov-08 21:23
cwjcyberfox6-Nov-08 21:23 
GeneralRe: How to fire the target button(in a content page) when I press "Enter" key Pin
Sandeep Akhare6-Nov-08 21:42
Sandeep Akhare6-Nov-08 21:42 
GeneralRe: How to fire the target button(in a content page) when I press "Enter" key Pin
cwjcyberfox6-Nov-08 23:54
cwjcyberfox6-Nov-08 23:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.