[program-l] PHP and Encrypting

  • From: Jeff Berwick <mailinglists@xxxxxxxxxxxx>
  • To: "program-l@xxxxxxxxxxxxx" <program-l@xxxxxxxxxxxxx>
  • Date: Sun, 21 Oct 2012 13:23:42 -0400

Hi all,

I have need to encrypt and decrypt information going into and out of a mysql 
database.  I am using PHP and have found the following code sample.  I don't 
know how secure this is and am wondering if there is a stronger encryption I 
can use.

$key is a string of characters and $string is the value to be encrypted.

$encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, md5(KEY), 
$string, MCRYPT_MODE_CBC, md5(md5(KEY))));

Security is not my forte, so I don't really understand how strong this really 
is.  It seems to generate a 44 character string.  Any thoughts are appreciated.

Thx,
Jeff

** To leave the list, click on the immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=unsubscribe]
** If this link doesn't work then send a message to:
** program-l-request@xxxxxxxxxxxxx
** and in the Subject line type
** unsubscribe
** For other list commands such as vacation mode, click on the
** immediately-following link:-
** [mailto:program-l-request@xxxxxxxxxxxxx?subject=faq]
** or send a message, to
** program-l-request@xxxxxxxxxxxxx with the Subject:- faq

Other related posts: