Re: [PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread Brad Bonkoski
ecause of the > implementation. > > Jason Sheets, CCNA, MCSE > > -Original Message- > From: Scott Fletcher [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, October 09, 2002 2:24 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Encrypting passwords in a flat file befor

RE: [PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread SHEETS,JASON (HP-Boise,ex1)
MCSE -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09, 2002 2:24 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Encrypting passwords in a flat file before import I was comparing it to what I was thinking about. Like if the field in the table (database) h

RE: [PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread SHEETS,JASON (HP-Boise,ex1)
PROTECTED]] Sent: Wednesday, October 09, 2002 2:48 PM To: 'SHEETS,JASON (HP-Boise,ex1)'; Scott Fletcher; [EMAIL PROTECTED] Subject: RE: [PHP] Encrypting passwords in a flat file before import Hi! I don't see yours in the PHP newsgroup. I understand what you meant and I don't have

RE: [PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread Scott Fletcher
y, October 09, 2002 4:35 PM To: 'Scott Fletcher'; [EMAIL PROTECTED] Subject: RE: [PHP] Encrypting passwords in a flat file before import Storing passwords in MD5 or another hash is an excellent idea because it is generally not possible to decrypt them (if the user uses a bad password they

Re: [PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread Scott Fletcher
I was comparing it to what I was thinking about. Like if the field in the table (database) have a username and password. Then you encrypt it with features like this, then how can it be de-crypt if I had like a thousand users account. It was just a thought in my mind. Now based on your responses

Re: [PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread Marco Tabini
I think that generally you do not want passwords to be decryptable. What I normally do is try to encrypt whatever the user enters as a password and compare the resulting encrypted string with what's in the database to make sure they correspond. If the encrypting function is univocal (and md5 is) t

Re: [PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread Scott Fletcher
Can it be de-encrypt??? I don't see how since you just use the function md5(). "Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > If you don't need the file to be changed to contain md5 encrypted > passwords use *fgetcsv() *to read the contenta,

Re: [PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread Marek Kilimajer
If you don't need the file to be changed to contain md5 encrypted passwords use *fgetcsv() *to read the contenta, then use *md5()* on the password and insert it into database using mysql_query. No need to write a new file. Verdon Vaillancourt wrote: >Hi, > >I hope this question isn't too basic

Re: [PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread Adam Voigt
Oh, and if you wanted to do it after you inserted, you could just do: mysql_query("UPDATE tablename SET pwfieldname = md5(pwfieldname);"); On Wed, 2002-10-09 at 08:39, Verdon Vaillancourt wrote: > Hi, > > I hope this question isn't too basic... > > I have a flat file (CSV) that I want to impor

Re: [PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread Adam Voigt
Off the top of my head I would use: $f = fopen("filename.csv","r"); $data = fread($f,filesize("filename.csv")); fclose($f); $split = explode("\n",$data); $counter = 0; foreach($split AS $row) { $myarray = explode(",",$row); $myarray[2] = md5($myarray[2]); $split[$counter

[PHP] Encrypting passwords in a flat file before import

2002-10-09 Thread Verdon Vaillancourt
Hi, I hope this question isn't too basic... I have a flat file (CSV) that I want to import into a mySQL db via phpMyAdmin. The file has about 1200 rows and is in a format like: "value","value","password","value","value","etc" The passwords are in clear text. I need them to be encrypted in md5.