Is this function safe?

Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.

Moderator: General Moderators

Post Reply
paulubz
Forum Newbie
Posts: 2
Joined: Tue Feb 26, 2008 4:19 am

Is this function safe?

Post by paulubz »

Is the crypt() function safe? If so, how do i use it? If not, any better?
User avatar
Mordred
DevNet Resident
Posts: 1579
Joined: Sun Sep 03, 2006 5:19 am
Location: Sofia, Bulgaria

Re: Is this function safe?

Post by Mordred »

"Safety" is not a concept that is applicable to functions, rather to their usage. There is no inherent safety or unsafety in a function, only when it's used. Show code.
paulubz
Forum Newbie
Posts: 2
Joined: Tue Feb 26, 2008 4:19 am

Re: Is this function safe?

Post by paulubz »

Okay, the code, using the CRYPT_STD_DES version goes like this:

Code: Select all

 
<?php 
$mypassword = crypt('mypasswordhere' , 'd4');
?>
 
Then I store this password into the database. How safe is it?
Post Reply