Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7935095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:49:13+00:00 2026-06-03T21:49:13+00:00

I have a form on my .jsp page which sends a password back to

  • 0

I have a form on my .jsp page which sends a password back to the server.

<form name="login" action="j_security_check" method="post">
    <input type="text" name="j_username">
    <input type="password" name="j_password">
    <input type="submit" name="Login"> </form>

I would like to do some processing on the j_password before processing it.
Previously, I managed to do this by implementing a JavaScript through some processing codes by calling on a function that performs something similar to below:

<script type="text/javascript" src="sha256.js">
<script> function hash() { document.login.j_password.value = '@' +
    sha256_digest(document.login.j_password.value); } </script>
...
...
    <input type="submit" value="Login" onClick="hash()"> </form>

Now, I am trying to implement a similar feature but instead of using JavaScript, I am trying to use Java. The main aim of my .java is to load a public.key, take the j_password, perform encryption, and replacing the j_password with its encrypted form.

// RSA.java Pseudocode
1) Get string from textbox "j_password"
2) Load public key from public.key
3) Perform encryption on j_password with key
4) Load cipher to textbox "j_password"

However, most examples I see implement a “<% %>” calling but this gives me an impression that it would perform on page load, rather than on clicking the login button. I also noticed I could compile it as a .class with javac and load it as an “” but can this method be used to modify the input of j_password? While it is a .jsp and I can implement Java directly with “<% %>”, I don’t think it is acceptable in current JSP standards. Does anyone have any recommendations or ideas to point me in the right direction?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T21:49:14+00:00Added an answer on June 3, 2026 at 9:49 pm

    You can use Filters for encryption, but it won’t be on the client side. As you can see in that list, filters are used for Encryption too, like you need for your purpose. The only way to intervene something is through the use of Filters. But if you need client side encryption, only way out is JavaScript.

    Further you can have a look at this and this.

    The second link provides a good explanation for hashing the password on client side. One of the answers mentions this :

    For this matter, more secure authentication protocols usually jump through a number of hoops in order to make sure, that such a replay attack cannot work, usually, by allowing the client to select a bunch of random bits, which are hashed along with the password, and also submitted in the clear to the server.

    On the server:

    • generate a few bits of random
    • send these bits (in clear text) to the client

    On the client:

    • generate a few random bits
    • concatenate password, the server’s random bits and the client random
      bits
    • generate hash of the above
    • submit random data (in clear text) and hash to the server

    As the server knows its own random information as well as the client’s random bits (it got them as clear text), it can perform essentially the same transformation. This protocol makes sure, that nobody listening in this conversation can use the information later to authenticate falsely using the information recorded (unless a very weak algorithm was used…), as long as both parties generate different “noise bits” each time, the hand shake is performed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: index.jsp: <form name=f action=db/ajoutConducteur.jsp method=post> <input type=text pattern=\d{8} required
I have a form <form name=frmMain method=POST action=processUpload.jsp enctype=multipart/form-data> <p align=center><table border=1 align=center width=90%
<FORM NAME=form1 METHOD=POST action=some.jsp> <INPUT TYPE=text NAME=first VALUE=First> <INPUT TYPE=text NAME=second VALUE=Second> </FORM> When
I have a login.jsp page which contains a login form. Once logged in the
I have a jsp page(let's say page1.jsp) which have an html form with action=page2.jsp.
I have a JSP (AddDocument.jsp) with the following form: <form action= ${pageContext.request.contextPath}/project?to=submitAdd&idProject=${param.idProject} method=post name=form>
I have a jsp page which contains a form which calls a servlet, after
I have created one jsp form which contains the username textfield. On the click
I am using Struts1.3, I have Jsp page which is showing the list of
I have a form JSP web page, this form contains multiple instances of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.