Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
While sending password value from client side to server side i need to encrypt textbox value using javascript and receive that encrypted value in the server side.

Here in the link you'll find one example which will send encrypted value of textbox from client end to server end.
I'm trying to implement the same code, but this doesn't send encrypted textbox value from cilent side to server side. I do google regarding this, but no positive result found till now. Kindly help me to resolve this problem.

Thanks in advance.
Posted

There is encryption and encryption, different from each other like shy from land. Even though you need to use cryptography, the encryption is not what you need for passwords. Please see my past answers:
i already encrypt my password but when i log in it gives me an error. how can decrypte it[^],
storing password value int sql server with secure way[^],
Decryption of Encrypted Password[^].

Also, ideally, authentication should be performed on the page served through HTTPS protocol, not HTTP. Please see: http://en.wikipedia.org/wiki/Https[^].

—SA
 
Share this answer
 
Comments
sahabiswarup 27-Dec-13 23:19pm    
Thanks for your reply, but i've no privilege to use HTTPS; without using that i've to encrypted textbox value on the client side and send it to the server end.
In the above link you shared is not a solution, so kindly share some code relevant to my question.
Thanks in advance.
Sergey Alexandrovich Kryukov 27-Dec-13 23:28pm    
I said "ideally"...
Sorry, why do you think I should write code for you? You have all references, can read some documentation and write what you need, ask further questions if you stuck...
If you think the only solution is when you get ready-to-use code, you are wrong; perhaps you should hire a developer... :-)
—SA
sahabiswarup 27-Dec-13 23:41pm    
sorry! I don't mean that, i shared a code with you in the question and asked you regarding that only, if there any mistake in that code kindly point that out.
In that code one javascript function is called to encrypt textbox value when the button event is fired, but that encrypted value is not coming in the server end. Kindly have a look on this following code snippet
https://sites.google.com/site/santo01org/encryption-of-password-in-asp-net-login-page-through-javascript
H.Brydon 28-Dec-13 13:32pm    
Your first sentence I think you meant "authentication and encryption" but +5 anyhow...
Sergey Alexandrovich Kryukov 28-Dec-13 17:44pm    
Thank you, Brydon.
I actually meant to write exactly "encryption and encryption", to use such a pattern of speech. The meaning of it is: different classes of encryption, such as symmetric vs asymmetric, are so different in scenarios and logic, so the difference is like between encryption and not encryption. What is needed is covered by the wider term "cryptography".
—SA
If you encrypt password in client side and send it to server side, that would not be an ideal approach as anything is transparent in client side. User can see the code and encrypted data.

So, I would suggest you to take that to server side and encrypt there using some Encryption Algorithm and store in database.
 
Share this answer
 
Comments
sahabiswarup 28-Dec-13 0:05am    
That i did already, store encrypted value in SQL server; but i want to send the encrypted value from client to server end while submit button is clicked. Here is the example [https://sites.google.com/site/santo01org/encryption-of-password-in-asp-net-login-page-through-javascript], i've implemented the same logic, but that encrypted value is not showing in the server end.
You can debug and see what is happening, but as I suggested, if you are already encrypting at server side then no need to do this again at client side.
sahabiswarup 28-Dec-13 1:04am    
That encryption part is working in the server end, record saved in the database is in encrypted format, but though i need to encrypt the client side value and then i need to compare both records as these is our task!!
If you have any clue kindly share.

Thanks in advance.
Ok check the following links.

1. http://www.javascriptkit.com/script/cutindex6.shtml
2. https://github.com/mshang/base64-js

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900