Prev | Current Page 632 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"

PHP offers support for several encryption algorithms. Several of
the more prominent ones are described here.
?– Tip For more information about encryption, pick up the book Applied Cryptography: Protocols,
Algorithms, and Source Code in C, Second Edition by Bruce Schneier (John Wiley & Sons, 1995).
PHP??™s Encryption Functions
Prior to delving into an overview of PHP??™s encryption capabilities, it??™s worth discussing
one caveat to their usage, which applies regardless of the solution. Encryption over the
Web is largely useless unless the scripts running the encryption schemes are operating
on an SSL-enabled server. Why? PHP is a server-side scripting language, so information
must be sent to the server in plain-text format before it can be encrypted. There
are many ways that an unwanted third party can watch this information as it is transmitted
from the user to the server if the user is not operating via a secured connection.
For more information about setting up a secure Apache server, check out http://
www.apache-ssl.org. If you??™re using a different Web server, refer to your documentation.
Chances are that there is at least one, if not several, security solutions for your
particular server. With that caveat out of the way, let??™s review PHP??™s encryption functions.
Encrypting Data with the md5() Hash Function
The md5() function uses MD5, which is a third-party hash algorithm often used for
creating digital signatures (among other things).


Pages:
620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644