How to Decrypt?
-
I use this function for Encypt my strings,but I want to know how I can Decrypt string.
public string Md5AddSecret(string strChange) { //Change the syllable into UTF8 code byte[] pass = Encoding.UTF8.GetBytes(strChange); MD5 md5 = new MD5CryptoServiceProvider(); string strPassword = Encoding.UTF8.GetString(md5.ComputeHash(pass)); return strPassword; } protected void bntDisp_Click(object sender, EventArgs e) { try { TxtResult.Text = Md5AddSecret(TxtPassword.Text); } finally { Response.Redirect("UrPage.aspx"); } }
Thanks in Advance...:rose:Erasers are for people who are willing to correct their mistakes.
-
I use this function for Encypt my strings,but I want to know how I can Decrypt string.
public string Md5AddSecret(string strChange) { //Change the syllable into UTF8 code byte[] pass = Encoding.UTF8.GetBytes(strChange); MD5 md5 = new MD5CryptoServiceProvider(); string strPassword = Encoding.UTF8.GetString(md5.ComputeHash(pass)); return strPassword; } protected void bntDisp_Click(object sender, EventArgs e) { try { TxtResult.Text = Md5AddSecret(TxtPassword.Text); } finally { Response.Redirect("UrPage.aspx"); } }
Thanks in Advance...:rose:Erasers are for people who are willing to correct their mistakes.
This function may help you to decrypt string.
Public Function Decrypt(ByRef Data As String) As String Dim decData() As Byte = Convert.FromBase64String(Data) Dim decStr As String = ASCIIEncoding.ASCII.GetString(decData) Decrypt = decStr End Function
use SHA1 Algorithm for Encryption.Public Function Encrypt(ByRef Data As String) As String Dim sha As New SHA1Managed Convert.ToBase64String(sha.ComputeHash(Encoding.ASCII.GetBytes(Data))) Dim encData() As Byte = ASCIIEncoding.ASCII.GetBytes(Data) Dim encStr As String = Convert.ToBase64String(encData) Encrypt = encStr End Function
Regards. RahulPeople Laugh on me Because i am Different but i Laugh on them Because they all are same.
modified on Saturday, January 05, 2008 2:39:10 AM
-
I use this function for Encypt my strings,but I want to know how I can Decrypt string.
public string Md5AddSecret(string strChange) { //Change the syllable into UTF8 code byte[] pass = Encoding.UTF8.GetBytes(strChange); MD5 md5 = new MD5CryptoServiceProvider(); string strPassword = Encoding.UTF8.GetString(md5.ComputeHash(pass)); return strPassword; } protected void bntDisp_Click(object sender, EventArgs e) { try { TxtResult.Text = Md5AddSecret(TxtPassword.Text); } finally { Response.Redirect("UrPage.aspx"); } }
Thanks in Advance...:rose:Erasers are for people who are willing to correct their mistakes.
MD5 is not an encryption algorithm, its a hashing algorithm. Hashes don't "decrypt" - they are a summary (digest) of the information, a checksum. They are lossy. Have a look on wikipedia about the difference. You probably want to look at the RSA CryptoServiceProvider.
Mark Churchill Director Dunn & Churchill Diamond Binding: Zero to Data Layer in 3 mins
-
I use this function for Encypt my strings,but I want to know how I can Decrypt string.
public string Md5AddSecret(string strChange) { //Change the syllable into UTF8 code byte[] pass = Encoding.UTF8.GetBytes(strChange); MD5 md5 = new MD5CryptoServiceProvider(); string strPassword = Encoding.UTF8.GetString(md5.ComputeHash(pass)); return strPassword; } protected void bntDisp_Click(object sender, EventArgs e) { try { TxtResult.Text = Md5AddSecret(TxtPassword.Text); } finally { Response.Redirect("UrPage.aspx"); } }
Thanks in Advance...:rose:Erasers are for people who are willing to correct their mistakes.
-
I use this function for Encypt my strings,but I want to know how I can Decrypt string.
public string Md5AddSecret(string strChange) { //Change the syllable into UTF8 code byte[] pass = Encoding.UTF8.GetBytes(strChange); MD5 md5 = new MD5CryptoServiceProvider(); string strPassword = Encoding.UTF8.GetString(md5.ComputeHash(pass)); return strPassword; } protected void bntDisp_Click(object sender, EventArgs e) { try { TxtResult.Text = Md5AddSecret(TxtPassword.Text); } finally { Response.Redirect("UrPage.aspx"); } }
Thanks in Advance...:rose:Erasers are for people who are willing to correct their mistakes.
You cannot decrypt the hash. Hashes are one-way.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
-
MD5 is not an encryption algorithm, its a hashing algorithm. Hashes don't "decrypt" - they are a summary (digest) of the information, a checksum. They are lossy. Have a look on wikipedia about the difference. You probably want to look at the RSA CryptoServiceProvider.
Mark Churchill Director Dunn & Churchill Diamond Binding: Zero to Data Layer in 3 mins
Mark Churchill wrote:
You probably want to look at the RSA CryptoServiceProvider.
Can u give me reference link about RSA CryptoServiceProvider. Thanks in Advance...:rose:
Erasers are for people who are willing to correct their mistakes.
-
This function may help you to decrypt string.
Public Function Decrypt(ByRef Data As String) As String Dim decData() As Byte = Convert.FromBase64String(Data) Dim decStr As String = ASCIIEncoding.ASCII.GetString(decData) Decrypt = decStr End Function
use SHA1 Algorithm for Encryption.Public Function Encrypt(ByRef Data As String) As String Dim sha As New SHA1Managed Convert.ToBase64String(sha.ComputeHash(Encoding.ASCII.GetBytes(Data))) Dim encData() As Byte = ASCIIEncoding.ASCII.GetBytes(Data) Dim encStr As String = Convert.ToBase64String(encData) Encrypt = encStr End Function
Regards. RahulPeople Laugh on me Because i am Different but i Laugh on them Because they all are same.
modified on Saturday, January 05, 2008 2:39:10 AM
Thanks Rahul... :)
Erasers are for people who are willing to correct their mistakes.
-
Answer as above, MD5 cant be Decrypted. because it is a Digest algorithm. if u want to encrypt and decrypt message, DES and AES cryptography algorithm will be your selection.
regards Eric.W
modified on Sunday, January 06, 2008 7:50:18 AM
Eric.W wrote:
if u want to encrypt and decrypt message, DES and AES cryptography algorithm will be your selection.
Can u give me reference link about DES and AES Cryptography algorithm. Thanks in Advance...:rose:
Erasers are for people who are willing to correct their mistakes.
-
You cannot decrypt the hash. Hashes are one-way.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
Can u suggest me how to encrypt and decrypt a string...Any Reference link will be more helpful. Thanks in Advance...:rose:
Erasers are for people who are willing to correct their mistakes.
-
Can u suggest me how to encrypt and decrypt a string...Any Reference link will be more helpful. Thanks in Advance...:rose:
Erasers are for people who are willing to correct their mistakes.
Kasi Viswanathan wrote:
Can u suggest me how to encrypt and decrypt a string...
Try an actual encryption algorithm like Rijndael. It is in the .NET Cryptography namespace.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
-
Kasi Viswanathan wrote:
Can u suggest me how to encrypt and decrypt a string...
Try an actual encryption algorithm like Rijndael. It is in the .NET Cryptography namespace.
"I guess it's what separates the professionals from the drag and drop, girly wirly, namby pamby, wishy washy, can't code for crap types." - Pete O'Hanlon
Thanks Paul...
Erasers are for people who are willing to correct their mistakes.
-
Eric.W wrote:
if u want to encrypt and decrypt message, DES and AES cryptography algorithm will be your selection.
Can u give me reference link about DES and AES Cryptography algorithm. Thanks in Advance...:rose:
Erasers are for people who are willing to correct their mistakes.