473,394 Members | 1,875 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,394 software developers and data experts.

How to encrypt passwords

How to encrypt and decrypt password in php ? Is there any built-in function for encryption and decryption ? Help me friends..
Jan 29 '09 #1
6 1716
Dormilich
8,658 Expert Mod 8TB
try PHP's encryption functions. PHP: Cryptography Extensions
Jan 29 '09 #2
TheServant
1,168 Expert 1GB
md5() is probably the most popular and easy to use function. If you google "php encryption function" I am sure you will get your answers. Always try google first.
Jan 29 '09 #3
@Viji nellaiappan




Use md5(Password) for Encryption or other wise please try it on google first.
Jan 29 '09 #4
Markus
6,050 Expert 4TB
md5() is a hash and, therefore, will not be 'decrypted' (not easily, anyway). Passwords should be hashed. You should never need to see the actual password.
Jan 29 '09 #5
nathj
938 Expert 512MB
I read somewhere (http://mail.python.org/pipermail/pyt...er/281621.html) that md5 and sha1 were weakened and I have seen 2 passwords bring the same output. As a result it is thought that sha256 was now the way to go.

http://uk.php.net/manual/en/function.hash.php

Try something like:
Expand|Select|Wrap|Line Numbers
  1. $lcPasswordEnc = hash("sha256", $lcPasswordRaw);
  2.  
Hope that helps
nathj
Jan 29 '09 #6
Atli
5,058 Expert 4TB
@nathj
This is true, although to varying degrees.

MD5 is a pretty weak algorithm compared to todays standards. It has been very popular in the past, which is part of the reason why it is so weak today. People have been trying to crack it for years, and some have succeeded at it.(Or come close to it at least.)
There are also huge on-line databases, listing popular passwords and their respective hashes, so in many cases, your MD5 hash doesn't even need to be cracked. It can just be looked up.

SHA1 is much stronger, and is a much much better choice than MD5. Even tho it is not as strong as it's bigger brother, SHA256, your SHA1 hashes won't be cracked in a hurry. (Not yet, anyways)

SHA256 would be my choice. It's pretty much impossible to crack today. (As far as I've read.) Aiming higher is currently not really worth it, would be a waste of space in most cases, although if your really paranoid, you could try SHA512.

And there are of course other algorithms, but SHA is pretty much the standard today. (See hash_algos for a list of algorithms)
Jan 29 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: CoralineSage | last post by:
Hi all, I'm running a message board php app and one of the php files stores a username and password. That file is not encrypted, so anyone can actually get that username and password if they can...
6
by: Pratchaya | last post by:
How to encrypt URL Address ? ============================== Now i 'm play about PHP language . and now i want ot know how to " advance url display " like encrypt URL Address in browser ( IE ,...
14
by: msnews.microsoft.com | last post by:
How can I encrypt and decrypt string?
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 ? ...
3
by: Luis Esteban Valencia | last post by:
Hello I want to encrypt the sqlconenction string on the xml configuration files. The problem is the following I have an application at my company that accesses a sql server local database. ...
1
by: Microsoft | last post by:
Hi I'm not able to find a newsgroup for classic asp so I'm writing here hoping someone can help me So, I have to encrypt and also decrypt some user passwords I know md5 algoritm is a one way...
8
by: toupeira23 | last post by:
Hello, I'm trying to encrypt passwords in my app. After discovering that there's no simple function to do this, I wrote a wrapper class which decodes a string using UTF8, encrypts it with...
8
by: Declan Barry | last post by:
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...
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...
4
by: kiranbabu | last post by:
Any one help me how to encrypt and decrypt passwords.And the password field is in database(mysql database) how to encrypt and decrypt that password saved in database.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.