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 Decode Password from .htaccess file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Decode Password from .htaccess file?" Watch "Decode Password from .htaccess file?" New topic

Decode Password from .htaccess file?

Drew Lane
Ranch Hand

Joined: May 13, 2001
Posts: 296
I need to decode some passwords using Java that were stored in an Unix .htacess file.
Does anyone know if this uses Base64 encoding?
Any suggestions for decoding these passwords?
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

I don't think this is possible, and it isn't Base64 encoded.
From what I understand, the password stored for htAccess is the result of a one-way hash function. That is, once you have converted a password into its hash, there's no going back.
Validation is done by getting the password, hashing it again, then comparing the two hashed values.
I'd be happy to be wrong though.
Drew Lane
Ranch Hand

Joined: May 13, 2001
Posts: 296
Would you happen to have a Java code snippet that shows the validation process?
I agree. Here's the link:
subject: Decode Password from .htaccess file?
Similar Threads
Parsing huge file without reading into memory
Where should I keep my passwords?
Password Encoding/decoding
My app uses a .txt file to retreive a list of usernames and passwords, can I jar it?
Object Memory- Runtime