473,836 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6324
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*******@attgl obal.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*****@barryw eb.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*******@attg lobal.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.********@gma il.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*******@attg lobal.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*******@attgl obal.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*******@attgl obal.net
=============== ===
Feb 9 '06 #8

"Jerry Stuckle" <js*******@attg lobal.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}fizzl eblat")
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*******@attgl obal.net
=============== ===

Feb 16 '06 #9

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

Similar topics

1
7966
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 there is a method which can generate a same with the same input string? There is a need to transfer file between to site,and the customer wish to encrypt these files during transfering,and they want to store a string into each database at...
11
4901
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 prevent tampering) data gets transmitted at night to the home office of my company. Rewriting this application in .NET is not an option as the application was 5 years in development.
2
10391
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
5996
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 = "true" userName="registery:HKLM:\SOFTWARE\MYAPP\identity\ASPNET_SE TREG,userName" password=="registery:HKLM:\SOFTWARE\MYAPP\identity\ASPNET_S
3
2473
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 ? FormsAuthentication.Encrypt produces an encrypted string, but it is for use in a ticket. On the other hand, FormsAuthentication.HashPasswordForStoringInConfigFile produces an encrypted string for use in a config.xml file.
7
7844
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 them in a database, but since there will be much more than 2go, I'm going to need multiple database, and it's no good for CPU performance... I read about encrypting picture instead of storing them in a DB. But I only found thing about string...
4
10848
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 resulting app.config file the value is encrypted? If so, (1) How do you specify the value to be encrypted? And (2) How do you access it now from VB? Can you still go through My.Settings?? Tom --
6
11971
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 solution(windows service). Is there any built in method in.Net that I can use. The flow would be like this: Accept username/password from .Net installer dialog V
4
2796
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 to print it on every page that the application prints out. That way, even if some other user gives out his password, it won't do any good, since the organization name will be the original user's.
0
9825
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9671
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10553
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10596
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10255
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9382
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6980
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4459
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.