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. encrypt at javascript and descrypt at server side asp.net

encrypt at javascript and descrypt at server side asp.net

Scheduled Pinned Locked Moved ASP.NET
csharpjavascriptasp-netsysadminalgorithms
5 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.
  • Z Offline
    Z Offline
    Zeyad Jalil
    wrote on last edited by
    #1

    Hi, I want to encrypt a password at client side (javascript) and decrypt the password again in the server side (Asp.Net). Please give me a sample or the best algorithm to do that. Thanks All

    L C Richard DeemingR 3 Replies Last reply
    0
    • Z Zeyad Jalil

      Hi, I want to encrypt a password at client side (javascript) and decrypt the password again in the server side (Asp.Net). Please give me a sample or the best algorithm to do that. Thanks All

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      No, you don't, passwords should be hashed not encrypted. If you can decrypt the password then so can a hacker.

      1 Reply Last reply
      0
      • Z Zeyad Jalil

        Hi, I want to encrypt a password at client side (javascript) and decrypt the password again in the server side (Asp.Net). Please give me a sample or the best algorithm to do that. Thanks All

        C Offline
        C Offline
        CAReed
        wrote on last edited by
        #3

        Since the encryption key will be needed by both client and server, how will be able to share the key with both without exposing it to the hacker community at large? The answer is that you cannot, especially since the client will likely have the decryption key (or same key if you're using symmetric encryption) exposed and vulnerable. As Richard suggested, use a hash algorithm instead, so that you can perform the same hashing on the server and then compare the hash values on the server-side. Just do a search for JavaScript hashing functions and use the corresponding algorithm built into .NET.

        Christopher Reed "The oxen are slow, but the earth is patient."

        1 Reply Last reply
        0
        • Z Zeyad Jalil

          Hi, I want to encrypt a password at client side (javascript) and decrypt the password again in the server side (Asp.Net). Please give me a sample or the best algorithm to do that. Thanks All

          Richard DeemingR Offline
          Richard DeemingR Offline
          Richard Deeming
          wrote on last edited by
          #4

          Get an SSL[^] certificate installed on your site, and make sure your page is only loaded over HTTPS[^]. That way, the system automatically encrypts any communication between the client and the server, and your code doesn't need to change.


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

          Z 1 Reply Last reply
          0
          • Richard DeemingR Richard Deeming

            Get an SSL[^] certificate installed on your site, and make sure your page is only loaded over HTTPS[^]. That way, the system automatically encrypts any communication between the client and the server, and your code doesn't need to change.


            "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

            Z Offline
            Z Offline
            ZurdoDev
            wrote on last edited by
            #5

            Most logical answer given the information. :thumbsup:

            There are only 10 types of people in the world, those who understand binary and those who don't.

            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