This week's book giveaway is in the Java in General forum.
We're giving away four copies of Java by Comparison (eBook) and have Simon Harrer, Jörg Lenhard, Linus Dietz on-line!
See this thread for details.
Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

My app uses a .txt file to retreive a list of usernames and passwords, can I jar it?  RSS feed

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will post the code for the classes if anyone needs to see it. Thanks in advance for the help.
 
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes you can.
However, when you open a stream to the file to read the contents, you should be doing it using the getClass().getResource() method.
 
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But then new users can't be added and existing users can't be removed.
 
Sheriff
Posts: 57778
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And anybody who has a copy of the .jar can unzip it and read all the passwords.
 
Saloon Keeper
Posts: 1752
44
Eclipse IDE Google Web Toolkit Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
an out of the topic answer:

1. Do not store username and passwords in text file.
2. Store them in database.
3. If possible, hash the passwords before storing in database.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!