473,386 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

MD5 encrypt a list of password from a file

Hi all..

Does anyone have a php script that would allow me to encrypt the
contents of a txt file?

I have an excel file which has a list of usernames and generated
passwords. What I would like to do is copy out the plaintext
passwords to a txt file and then do a conversion to encrypt the
passwords using MD5 encryption as they will then be imported into a
MySQL database.

Is that possible?

I can do them one at a time using a small php script but I've approx
100+ to do.

Regards

Declan Barry
Feb 8 '06 #1
8 6290
Declan Barry wrote:
Hi all..

Does anyone have a php script that would allow me to encrypt the
contents of a txt file?

I have an excel file which has a list of usernames and generated
passwords. What I would like to do is copy out the plaintext
passwords to a txt file and then do a conversion to encrypt the
passwords using MD5 encryption as they will then be imported into a
MySQL database.

Is that possible?

I can do them one at a time using a small php script but I've approx
100+ to do.

Regards

Declan Barry


I wouldn't even write code for it. Just export the data to CSV, import
it into MySQL and do it from there.

For instance, if your excel file has

userid password

Create three columns in your table - uid, temppw and pw. Export the
Excel file as CSV format and load it into the table. Then simply update
the table, setting pw to MD5(temppw).

The just drop the temppw column.

No programming required.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 8 '06 #2
Declan Barry wrote:
Does anyone have a php script that would allow me to encrypt the
contents of a txt file?


Note that MD5 is not encryption. It is a hash that irreversibly
transforms input into a small (8 byte?) value.

Cheers,
Nicholas Sherlock
Feb 9 '06 #3
On 2006-02-08, Declan Barry <dp*****@barryweb.co.uk> wrote:
Hi all..

Does anyone have a php script that would allow me to encrypt the
contents of a txt file?

I have an excel file which has a list of usernames and generated
passwords. What I would like to do is copy out the plaintext
passwords to a txt file and then do a conversion to encrypt the
passwords using MD5 encryption as they will then be imported into a
MySQL database.

Is that possible?
I can do them one at a time using a small php script but I've approx
100+ to do.


php has loops... past them into an array in your script ...
Bye.
Jasen
Feb 9 '06 #4
Hi Jerry..

Thanks for that. I later discovered that on another website but I
also found a VBA macro that I was able to plug into excel to do the
same way. Mind you, the method you described sounds easier.

One query though. What happens if you already had some password data
in there in the first place. Does it get encrypted (.Sorry.. Hashed)
again thus making the original hash totally whacked out?

Declan

On Wed, 08 Feb 2006 16:53:20 -0500, Jerry Stuckle
<js*******@attglobal.net> wrote:
Declan Barry wrote:
Hi all..

Does anyone have a php script that would allow me to encrypt the
contents of a txt file?

I have an excel file which has a list of usernames and generated
passwords. What I would like to do is copy out the plaintext
passwords to a txt file and then do a conversion to encrypt the
passwords using MD5 encryption as they will then be imported into a
MySQL database.

Is that possible?

I can do them one at a time using a small php script but I've approx
100+ to do.

Regards

Declan Barry


I wouldn't even write code for it. Just export the data to CSV, import
it into MySQL and do it from there.

For instance, if your excel file has

userid password

Create three columns in your table - uid, temppw and pw. Export the
Excel file as CSV format and load it into the table. Then simply update
the table, setting pw to MD5(temppw).

The just drop the temppw column.

No programming required.


Feb 9 '06 #5
Hi Nicholas..

Thanks for that. I gathered initially that I was using the phrase
incorrectly but thought I'd use it to describe it in its simplistic
form.

What is the difference actually?

Declan

On Thu, 09 Feb 2006 13:14:19 +1300, Nicholas Sherlock
<N.********@gmail.com> wrote:
Declan Barry wrote:
Does anyone have a php script that would allow me to encrypt the
contents of a txt file?


Note that MD5 is not encryption. It is a hash that irreversibly
transforms input into a small (8 byte?) value.

Cheers,
Nicholas Sherlock


Feb 9 '06 #6
Bandit wrote:
Hi Jerry..

Thanks for that. I later discovered that on another website but I
also found a VBA macro that I was able to plug into excel to do the
same way. Mind you, the method you described sounds easier.

One query though. What happens if you already had some password data
in there in the first place. Does it get encrypted (.Sorry.. Hashed)
again thus making the original hash totally whacked out?

Declan

On Wed, 08 Feb 2006 16:53:20 -0500, Jerry Stuckle
<js*******@attglobal.net> wrote:


Yes, in this means it would be hashed again.

If all the passwords are hashed, just don't do the MD5 step. If none of
them are hashed, you need to do the MD5 step.

But if some of them are hashed and some not, you'll have to examine each
record individually and hash those which aren't.

Or, if you have two password columns in your Excel table (one plain, one
hashed), you could just hash them for those which aren't already hashed
(i.e. hashed pw length = 0).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 9 '06 #7
Bandit wrote:
Hi Nicholas..

Thanks for that. I gathered initially that I was using the phrase
incorrectly but thought I'd use it to describe it in its simplistic
form.

What is the difference actually?

Declan

Declan,

Encryption can be always be reversed (decrypted). Hashing generally cannot.

Also, please don't top post. Thanks.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Feb 9 '06 #8

"Jerry Stuckle" <js*******@attglobal.net> wrote in message
news:x5******************************@comcast.com. ..
Declan Barry wrote:
Hi all..

Does anyone have a php script that would allow me to encrypt the
contents of a txt file?

I have an excel file which has a list of usernames and generated
passwords. What I would like to do is copy out the plaintext
passwords to a txt file and then do a conversion to encrypt the
passwords using MD5 encryption as they will then be imported into a
MySQL database.

Is that possible?

I can do them one at a time using a small php script but I've approx
100+ to do.

Regards

Declan Barry
I wouldn't even write code for it. Just export the data to CSV, import it
into MySQL and do it from there.

For instance, if your excel file has

userid password

Create three columns in your table - uid, temppw and pw. Export the Excel
file as CSV format and load it into the table. Then simply update the
table, setting pw to MD5(temppw).


one thing that will make your passwords harder to crack is by prepending and
appending some fixed string to the password in question before feeding it to
MD5()
like MD5("hornswigl{$password}fizzleblat")
when you go to compare passwords, you of course need to use the same thing
on one side to compare with your db.

The just drop the temppw column.

No programming required.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Feb 16 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: wqhdebian | last post by:
As far as I know,when encrypt or decrypt ,a key must first be got,and the key is first generate by a tool or from SecurityRandom,that means I can not generate the same key with the same input.Does...
11
by: underwmd | last post by:
Hello, My problem is two fold. 1) I must support a deployed legacy application written in VB6 SP5. I need to export data from a database, compress it and the encrypt the data using 3DES (to...
2
by: Anilza Popat | last post by:
I would like to know how to encrypt and decrypt files using c#. I want a program that asks for password before encrypt or decrypt the file. best regards
1
by: Anand | last post by:
Hi, I want to encrypt userid and password on the web config file. I ran the aspnet_setreg.exe and encrypted it on the registry and in the web config file i wrote <identity impersonate =...
3
by: Alex Nitulescu | last post by:
Hi. I am writing an app which stores usernames/passwords and email addresses in a database table. The question is how can I encrypt the password provided by the user ? ...
7
by: Jean Christophe Avard | last post by:
Hi! I am designing an application wich comes with image file. These images are copyrighted and they have to be accessible only from within the application. At first, I tought I was going to store...
4
by: Tom | last post by:
Is it possible to encrypt a value in the my.settings area in VB.NET 2005? I.E. Can I add a settings value (via My Project / Settings) and have it encrypt that value so that if anyone looks at the...
6
by: Aneesh P | last post by:
Hi All, I need to encrypt some fields esp password key values in configuration file while installting the application using .Net installer project and decrypt those values from my...
4
by: Gilles Ganault | last post by:
Hello I'd like to encrypt a customer's organization name to use this as their password to launch our application, and decrypt it within our VB5 application. We will then use this information...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.