Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to Decrypt?

How to Decrypt?

Scheduled Pinned Locked Moved ASP.NET
tutorialquestion
12 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Kasi Viswanathan

    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.

    M Offline
    M Offline
    Mark Churchill
    wrote on last edited by
    #3

    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

    K 1 Reply Last reply
    0
    • K Kasi Viswanathan

      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.

      E Offline
      E Offline
      Eric W
      wrote on last edited by
      #4

      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

      K 1 Reply Last reply
      0
      • K Kasi Viswanathan

        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.

        P Offline
        P Offline
        Paul Conrad
        wrote on last edited by
        #5

        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

        K 1 Reply Last reply
        0
        • M Mark Churchill

          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

          K Offline
          K Offline
          Kasi Viswanathan
          wrote on last edited by
          #6

          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.

          1 Reply Last reply
          0
          • R rahul net11

            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. Rahul

            People 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

            K Offline
            K Offline
            Kasi Viswanathan
            wrote on last edited by
            #7

            Thanks Rahul... :)

            Erasers are for people who are willing to correct their mistakes.

            1 Reply Last reply
            0
            • E Eric W

              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

              K Offline
              K Offline
              Kasi Viswanathan
              wrote on last edited by
              #8

              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.

              E 1 Reply Last reply
              0
              • P Paul Conrad

                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

                K Offline
                K Offline
                Kasi Viswanathan
                wrote on last edited by
                #9

                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.

                P 1 Reply Last reply
                0
                • K Kasi Viswanathan

                  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.

                  P Offline
                  P Offline
                  Paul Conrad
                  wrote on last edited by
                  #10

                  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

                  K 1 Reply Last reply
                  0
                  • P Paul Conrad

                    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

                    K Offline
                    K Offline
                    Kasi Viswanathan
                    wrote on last edited by
                    #11

                    Thanks Paul...

                    Erasers are for people who are willing to correct their mistakes.

                    1 Reply Last reply
                    0
                    • K Kasi Viswanathan

                      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.

                      E Offline
                      E Offline
                      Eric W
                      wrote on last edited by
                      #12

                      visit here,it mey be helpful for u.

                      regards Eric.W

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups