Module 11 MySQL PHP OpenSSL Data Security v1.7
© April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada
www.globalopenversity.org CIS105 – PHP Programming
1
Global Open Versity IT Systems Integration Hands-on Labs Training Manual
Deploy MySQL Database Encryption using PHP and OpenSSL to Protect Customers Credit Card Info
Kefa Rabah Global Open Versity, Vancouver Canada
Table of Contents Page No.
MODULE 11
ERROR! BOOKMARK NOT DEFINED.
DELIVERING MYSQL SECURITY WITH PHP AND OPENSSL
ERROR! BOOKMARK NOT DEFINED.
11.0 Introduction & Historical Overview to IT Security 3
11.1 Introduction to Cryptography 10
11.1.1 Digital Signature 10
11.1.2 Digital Certificate 11
11.1.3 Public Key Infrastructure (PKI) 11
11.1.4 Why Encrypt Data? 11
11.2 Secure Socket Layer (SSL) Certificate - Now Transport Layer Security (TLS): How It Works 13
11.3 Data Security 14
11.3.1 Data Encryption 15
11.3.2 OpenSSL in PHP 15
11.3.2.1 OpenSSL Functions 15
11.3.2.2 Generating the Digital Certificates 15
11.3.2.3 Getting the Keys 15
11.4 OpenSSL in PHP: Encrypting Data 16
11.4.1 Using OpenSSL in PHP Data Encryption 17
11.5 Crypto-Keys & Digital Certificates 17
11.5.1 How do I generate an RSA keys? 17
11.5.2 How do I generate a self-signed certificate? 18
11.5.3 How do I generate a certificate request for VeriSign? 19
11.5.4 Data Encryption 19
11.5.5 Data Encryption – via Signing Data 21
11.5.6 Data Encryption – via Signed Sealed Data 22
11.5.7 Data Encryption – via Signed Sealed Data 24
11.6 MySQL with PHP and OpenSSL 27
11.6.1 Storing Credit Card Information 28
11.6.2 Which Encryption Algorithm to use? 28
Module 11 MySQL PHP OpenSSL Data Security v1.7
© April 2007, Kefa Rabah, Global Open Versity, Vancouver Canada
www.globalopenversity.org CIS105 – PHP Programming
2
11.6.3 PHP's MySQL Support 28
10.6.3.1 Storing MySQL Database in Unsecured Form 29
11.6.3.1 Encrypting MySQL Database using MySQL PHP and OpenSSL 31
11.7 Secure Implementation of Message Digest, and Authentication 34
11.7.1 The Mechanics of the Hash Algorithm 35
11.7.2 A PHP Implementation of Message Digest Algorithms 35
11.7.3 Implementing password hashing with PHP and MySQL database 36
11.8 HowTo Generate and Install SSL in Tomcat Webserver on Windows 38
11.9 Final Thought - Security Policies! 41
11.10 What is Risk with Respect to Information Systems? 42
11.10.1 Dealing or Not Dealing With Risks 42
END-MOD.11 43
© A GOV Open Knowledge Access Technical Academic Publications License
Enhancing education & empowering people worldwide through eLearning in the 21st Century