View Full Version : passwords and encryption
benjgoldstein
12-04-2002, 09:27 PM
I am making a basic accounting-like program for a friend of mine and he was hoping I'd be able to set it up so it could have a user name and password and so the information he saved would be either hidden or saved into a text file in a manner that the casual computer user would not be able to understand it. I'm sure java isn't the best language for such things, but it is all i know. The "encryption" system would not have to be very fancy at all... Anyone have a recommendation of how I might store the information? Thanks a lot.
inkedmn
12-05-2002, 04:30 AM
every java object inherits from Object, which has a hashcode() method. you could just take the password input, get the password's hashcode, and use that. then, whenever somebody tried to login, take the hashcode of the supplied password and compare the two...
gufmn
12-05-2002, 02:30 PM
You could use a simple rot13. I think there was a competition thread for that here somewhere and I would wager it's already been done in java.
Take a look at the java.crypto (I believe) package. I've read that it has good cryptology. If not, the book by O'Reilly Learning Java has a rot13 code example.
Dru Lee Parsec
12-05-2002, 06:01 PM
Found it! http://java.sun.com/products/jce/ The Java Cryptography extension.
Looks like it's integrated into the 1.4 release already. Cool! I'll have to play with it.
vBulletin® v3.7.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.