phpCollab Community
Discuss everything phpCollab!

The forums are currently in READ-ONLY mode while we upgrade the forums.
Home » Development » Development » Password Encryption Help Please (How use the same encryption in MOD)
Password Encryption Help Please [message #8454] Tue, 23 September 2008 20:46 Go to next message
scansterz is currently offline  scansterz
Messages: 5
Registered: April 2008
phpCollab guest
I am working on a time keeping mod for my iPhone and have tied it to PHPCOLLAB.
The only thing I need help with is the password encryption used...
What I want to do is be able to log in either Collab-Mobi or PHPcollab and have access...
Can anyone 'dig out' the one function that will allow me to do that? So far I am stuck...
Thanks in advance for your help.

Re: Password Encryption Help Please [message #8456 is a reply to message #8454] Wed, 24 September 2008 08:47 Go to previous messageGo to next message
mindblender is currently offline  mindblender
Messages: 610
Registered: July 2003
Location: AZ
phpCollab contributor

Passwords can be stored one of three ways. Plain text, MD5 hash or Crypt.

Check the ~/includes/library.php for the functions that handle password validation
Re: Password Encryption Help Please [message #8457 is a reply to message #8454] Wed, 24 September 2008 09:22 Go to previous messageGo to next message
scansterz is currently offline  scansterz
Messages: 5
Registered: April 2008
phpCollab guest
Thank you very much. Yea, I saw that file. I did not under stand it enough to pull out that ONE function. I also tried several and it did not seem to work. I want both systems to recognize the login. I see where you can set which type, but don't see the one function for reading the password that is in teh db and translating it back and forth. Any name would be good, and I'll put that function out and place it in my code and see if it works. I am making a new directory under phpcollab like mantis, so I know I could just include, however it asks for alot of other files when I do that...so I just want the function. the last part that is not working, and I have tried, is making the browser believe I am logged into both the systems. I need help writing that... like a login from a different directory. I don't like the way Mantis does it, that is what I am trying to avoid. My last item I will do is to place a 'TIME' icon in each task row in PHPcollab.
This think I wrote runs nicely on the iPhone so I have my list and tasks pretty fast on the go and I can keep track of time.
Thanks again.
Re: Password Encryption Help Please [message #8458 is a reply to message #8454] Wed, 24 September 2008 10:22 Go to previous messageGo to next message
mindblender is currently offline  mindblender
Messages: 610
Registered: July 2003
Location: AZ
phpCollab contributor

The function is called is_password_match on/near line 454-521 in the library.php file.

If the method is MD5, then you will need to encode the password in MD5 and then compare the hash with what is stored in the database. If it is crypt, then you can just use the same encryption method in that function to encode the password then verify it against what is in the database.

Wish I had an iPhone so I could help you develop your app Sad

Let me know if you encounter any problems.

Jeff
Re: Password Encryption Help Please [message #8467 is a reply to message #8458] Wed, 01 October 2008 14:50 Go to previous messageGo to next message
scansterz is currently offline  scansterz
Messages: 5
Registered: April 2008
phpCollab guest
Thank you very much. I am looking at this today and trying to make it work.
Re: Password Encryption Help Please [message #8470 is a reply to message #8454] Wed, 01 October 2008 16:34 Go to previous messageGo to next message
norman77 is currently offline  norman77
Messages: 15
Registered: September 2008
Location: Cedar Rapids, IA
phpCollab guest

If help is required.. I don't have an iphone, but I have a PPC phone.. using IExplorer Mobile (Trying to get skyfire working too)..

Dave

icon14.gif  Re: Password Encryption Help Please [message #8471 is a reply to message #8454] Wed, 01 October 2008 18:24 Go to previous message
scansterz is currently offline  scansterz
Messages: 5
Registered: April 2008
phpCollab guest
Very cool. What will be cool if you test on this other platforms as time goes forward.
FYI to all who are reading this.

1. My first version is set for an online application - any browser - this is pretty much stand alone and done.
2. The second version is ajax enabled set for iPhone and tied to phpcollab.
3. The third version I want is a downloadable ap for the iPhone.. not run on the web, but talking to the DB... that would be tricky since we don't know the DB information yet...
I have not started on that.

When I get the phpcollab one (#2) up and running, i'll try to send a test URL for ya... regular phpcollab login and registration... once done with that you'll be able to go mobile with it... the main difference is the mobi-time ( still deciding on the name(s) collab-mobi, miTim [my Time] ) will be able to start and stop time per task and add it up for the project +.

After this is tested I think I will release it to download the code and graphics. Here is a screen shot so far...


Today I got the login working...with CRYPT only.
I added:
$salt = substr($_POST['password'], 0, 2 );
above my sceme to login...
then added:
$password=( crypt($_POST['password'],$salt) );
to the login sceme I came up with. I did not have to call any functions from phpcollab...that is why it is CRYPT only so far.

I know that will leave others out who choose the other methods, but that is the way I use this phpcollab... and I had to set that in settings... somewhere.
I may need help with MD5 type of situation.
Thanks so much for pointing me in the right direction. btw: the other cool stuff is in thehtpasswd.class.php
  • Attachment: Picture 1.png
    (Size: 54.04KB, Downloaded 366 times)
Previous Topic: Bug 1928082
Next Topic: Bug 2140690
Goto Forum:
  


Current Time: Sun May 26 07:16:22 CEST 2013

Total time taken to generate the page: 0.27931 seconds