Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: How to store password?

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to store password?

    Hi all,

    I'm developing an application which read some data from a db.
    The connection to the db is performed through standard login/password mechanism.

    The problem is: how to store the db password?
    If I store it as a class member, it can be easily retrieved through a decompiling operation.

    I think that obfuscation doesn't solve the problem, since a string password can be found easily also in obfuscated code .

    Anyone has suggestions?


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: How to store password?

    Create a multi-tier application, where an inner tier residing on a server performs all database IO and your application connects to the server application - not directly to the database. Client communicates to the server through some type of communication (eg Object serialization, xml, text, etc...not direct SQL commands) and the server performs the SQL operations.
    For example:
    Client <--> [Inner Tier (server application) <--> Database]
    Where [] is one or more servers.

  3. #3
    Member
    Join Date
    Nov 2011
    Posts
    37
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: How to store password?

    Hi,
    You can use SHA to encrypt the password too.

    Core java
    Last edited by mr.miku; January 11th, 2012 at 07:20 PM.

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: How to store password?

    Quote Originally Posted by mr.miku View Post
    Hi,
    You can use SHA to encrypt the password too.
    How does this solve the original posters problem?

Similar Threads

  1. Problem with store procedures and Hibernate
    By zecute in forum JDBC & Databases
    Replies: 0
    Last Post: May 20th, 2011, 06:39 AM
  2. How to store objects from a class inn an array?
    By dironic88 in forum Object Oriented Programming
    Replies: 1
    Last Post: April 7th, 2011, 02:42 PM
  3. How to store 10 inputs in an arraylist?
    By Bray92 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 20th, 2011, 10:22 PM
  4. store a list/string for each object
    By tommy in forum Object Oriented Programming
    Replies: 5
    Last Post: May 28th, 2010, 09:24 AM
  5. can store image&text in rms seperately but NOT together :(
    By wildheart25c in forum Java ME (Mobile Edition)
    Replies: 2
    Last Post: March 26th, 2010, 07:59 AM

Tags for this Thread