Security is a big subject that can't be addressed adequately in a forum like this. The
SecurityFaq links to a number of articles about what threats to watch out for, how to guard against those threats, and how you might use
Java's features and 3rd party libraries to do that.