File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Java program protection. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java program protection." Watch "Java program protection." New topic

Java program protection.

xD xD

Joined: Mar 10, 2006
Posts: 1
I'm trying to protect a calculator so that it only can be used when logged in on a website. Can someone explain me how I could do this?

mail to please I'm desperate
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2398
Is it an applet?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Hello "xD xD"-

Welcome to JavaRanch.

On your way in you may have missed that JavaRanch has a policy on display names, and yours does not comply with it - please adjust it accordingly, which you can do right here. Thanks for your prompt attention to this matter.

We also ask that people don't post their email address; we like to keep conversations in the forums, so that everybody can benefit from the answers. Please edit your post to remove it.

Enjoy your time here.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
As to your question, the answer would seem to be authentication. If this is part of a web app, then you can add basic or form authentication to protect the page. The Tomcat FAQ page has some pointers on how to set up web app security.
ak pillai
Ranch Hand

Joined: Feb 11, 2006
Posts: 288
Have a login page. Every time before you display your calculator page, check your HttpSession object to make sure that the user has logged in. when the user logout of your site, invalidate your session. You can store the usernames and passwords in DataBase, LDAP server or flat files.

google for form-based authentication.

Authentication methods:

-- Basic/Digest authentication: Browser specific and password is encoded using Base-64 encoding. Digest is similar to basic but protects the password through encryption. This is a simple challenge-response scheme where the client is challenged for a user id and password. The Internet is divided into realms.

-- Form-based authentication: Most Web applications use the form-based authentication since it allows applications to customise the authentication interface. Uses base64 encoding which can expose username and password unless all connections are over SSL. (Since this is the most common let us look at in greater detail together ie authentication & authorisation under Authorisation).

-- Certificate based authentication: Uses PKI and SSL. This is by far the most secured authentication method.

java j2ee job interview questions with answers | Learn the core concepts and the key areas
I agree. Here's the link:
subject: Java program protection.
It's not a secret anymore!