• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Encrypting using Javascript

Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers..
I'm doing a project in JSP and Oracle.. When i give the username and password it has to be encrypted and stored in the database
when we enter the username and password and submit at that time it has to encrypt the password and has to send the encrypted password to the next page!!

the code i'm planning is

<input type="button" on_click="validate();return false;">
<script language = "java script">
function validate()
document.form1.method = "post";
document.form1.action = "nextpage.jsp";
function encrypt()
var pass = document.form1.text2.value;
/*here i want to use the for loop for getting each character
but for that i want to use pass[i].. how can i do that!!
please help me ranchers....*/

Thanks in advance

Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First let me ask you the question I hate to here - why are doing this?
As a counter measure to sniffing? Think about this - if I am a hacker sniffing submited passwords, I don't really care what you typed in a browser, I only care what was submitted. So, you encrypt it or not, whatever goes to server - that what I will resend. Think about using https instead - it may be a better solution for you.

As far as encrypt goes, here is example for IE (it may or may not work in other browsers, I am too lasy to test):

also, take a look at http://pajhome.org.uk/crypt/index.html
Seriously Rick? Seriously? You might as well just read this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic