JavaScript or JavaApplet basic encryption suggestion

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Eli

    JavaScript or JavaApplet basic encryption suggestion

    Hi gurus,
    My question is about exchanging data on a basic HTML page between a
    JavaScript piece of code and a Java client-side <APPLET> residing on
    the same webpage.

    To demonstrate the idea of data encription at the client side to
    students my idea is to build a simple <FORM> on the webpage with 2
    text fields and a submit button. The student fills in the text field
    on top and click Submit. At this moment, onsubmit() sends the text
    field value to the client side applet which scrambles the contents and
    returns the "encrypted" result to the webpage. The result should be
    shown on the HTML page, inside the bottom text field.

    The exchange question to you gurus is very basic:
    q1. What is the proper syntax in the JavaScript to call the applet's
    method myScramble(Stri ng theOriginalText )?
    q2. What is the proper syntax in the method above to "return" the
    result to the HTML page form field named TheEncryptedTex t?

    Thank you all for taking the time to read the description above.
    Kind regards,

    Eli
  • David Dorward

    #2
    Re: JavaScript or JavaApplet basic encryption suggestion

    Eli wrote:

    It's been a while since I worked with JS <--> Applet but IIRC
    [color=blue]
    > q1. What is the proper syntax in the JavaScript to call the applet's
    > method myScramble(Stri ng theOriginalText )?[/color]

    objRef.myScramb le("foo");
    [color=blue]
    > q2. What is the proper syntax in the method above to "return" the
    > result to the HTML page form field named TheEncryptedTex t?[/color]

    public String myScramble(Stri ng theOriginalText ) {
    return "TheEncryptedTe xt";
    }

    .... of course there is a much easier and more reliable way to handle data
    encryption on the client side... HTTP with SSL.

    --
    David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is

    Comment

    • Eli

      #3
      Re: JavaScript or JavaApplet basic encryption suggestion

      Heaps of thanks David for your reply.
      Your suggestion about SSL will definitely be on the agenda in later stage.
      Kind regards,
      Eli

      Comment

      Working...