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

  • Home
  • SEARCH
  • 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 6576683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:32:33+00:00 2026-05-25T15:32:33+00:00

Some of the guys here are developing an application which incorporates some ‘secure areas’

  • 0

Some of the guys here are developing an application which incorporates some ‘secure areas’ accessible by logging in. In the past, the login form and subsequent ‘secure’ pages were all plain text transmitted over http, as it’s an application that goes out for use on shared servers where there is little chance of being able to use SSL (think WordPress and the like). Most people just shrugged their shoulders as that’s all they expected – it’s hardly a national bank.

We are now thinking of writing the next version using a JavaScript front end, with the advantage of loading all the images & CSS once, then writing HTML into the DOM thereafter with extJS (or maybe jQuery). We’d like to encrypt user input at the client before being sent to the server, then decrypt server output at the browser before being rendered to HTML so as to introduce some sort of security for users. There are also gains to be had with reducing page loading times, as we’re only sending gzipped JSON back and forth.

While playing around, we realised that the method we were looking at to encrypt the basic stuff also doubled up as an authentication mechanism for login in the first place.

For simplicity…:

  • The user connects to the login page over standard http, where the browser downloads the JavaScript package containing the hashing and encryption algorithms (SHA-256 and AES for example).
  • User enters username, password and secret into a login form.
  • The browser JavaScript sends a hash of username and password to the server via AJAX. The secret is only stored in JavaScript and is never sent across the internet.
  • The server looks up the hash and retrieves username and secret from the database.
  • The server sends a hash (same algorithm as the browser) of username and secret back to the browser.
  • The browser JavaScript creates a hash of username and secret and compares it to the hash sent back from the server.
  • If they are the same, the browser JavaScript encrypts response with secret and sends the message back to the server.
  • The server decrypts the message with secret to find the expected response and starts a new session.
  • Subsequent communications are encrypted and decrypted both ways with secret.

There seem to be a few advantages of this type of system, but are we right in thinking:

  • The user knows they are talking to their server if the server manages to create a hash of username and secret, proving the server knows and understands username and secret.
  • The server knows the user is genuine if they manage to encrypt response with secret, proving the user knows secret.
  • At no time is secret ever transmitted in plain text, or is it possible to determine secret from the hash.
  • A sniffer will only ever find out the ‘secure’ URL and detect compressed hashes and encryptions in the query string. If they send a request to to the URL that is malformed, no response is given. If they somehow manage to guess an appropriate request, they still have to be able to decrypt it.

It all seems quick enough as to be imperceptible to the user. Can anyone see through this, as we all just assumed we shouldn’t be playing with JavaScript encryption!

  • 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-05-25T15:32:34+00:00Added an answer on May 25, 2026 at 3:32 pm

    Don’t do this. Please use SSL/TLS. See Javascript Cryptography Considered Harmful.

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

Sidebar

Related Questions

guys need some insight here. I know the definition of a protocol, being new
I have some guys here who have code that needs to be compiled with
With the help of some of the guys here I have some regex to
I'm trying to refactor some code here that was done previously by other guys,
hi all i need some help from you guys.. well here's the description Guys
Some programmers here have been developing a project in VB6, and they say they
i Guys I need some help with some Regular expression: here is the string:
Here i have some code which is my slideshow and what i am wondering
Some guys where I work are setting up a new database server for SQL
I am trying to coach some guys on building web applications. They understand and

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.