<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Brandon Checketts &#187; Encryption</title> <atom:link href="http://www.brandonchecketts.com/archives/category/encryption/feed" rel="self" type="application/rss+xml" /><link>http://www.brandonchecketts.com</link> <description>Web Programming, Linux System Administation, and other geeky stuff</description> <lastBuildDate>Sun, 25 Jul 2010 00:50:58 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>MySQLDump To a Remote Server</title><link>http://www.brandonchecketts.com/archives/mysqldump-to-a-remote-server</link> <comments>http://www.brandonchecketts.com/archives/mysqldump-to-a-remote-server#comments</comments> <pubDate>Fri, 02 Jan 2009 22:18:47 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[Encryption]]></category> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[Security]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=277</guid> <description><![CDATA[I was running out of disk space on a server today.  The server had a large database table that was no longer used, so I wanted to archive it and then drop the table.  But the server didn&#8217;t have enough disk space to dump it out to disk before copying it off to [...]]]></description> <content:encoded><![CDATA[<p>I was running out of disk space on a server today.  The server had a large database table that was no longer used, so I wanted to archive it and then drop the table.  But the server didn&#8217;t have enough disk space to dump it out to disk before copying it off to a remote server for archiving.</p><p>The first thought was to run mysqldump dump on the destination machine, and to access the database over the network.  That however, doesn&#8217;t compress or encrypt the data.  Plus I would have had to create a mysql user with permission to access the database remotely.</p><p>The solution I came up with worked out well: mysqldump directly to the remote host with this command:</p><pre>
mysqldump &lt;DATABASE_NAME&gt; [mysqldump options] | gzip -c | ssh user@remotehost "cat > /path/to/some-file.sql.gz"
</pre><p>That pipes the mysqldump command through gzip, then to through and SSH connection.  SSH on the remote side runs the &#8216;cat&#8217; command to read the stdin, then redirects that to the actual file where I want it saved.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/mysqldump-to-a-remote-server/feed</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Getting Dkimproxy Installed and Configured</title><link>http://www.brandonchecketts.com/archives/getting-dkimproxy-installed-and-configured</link> <comments>http://www.brandonchecketts.com/archives/getting-dkimproxy-installed-and-configured#comments</comments> <pubDate>Sun, 22 Jun 2008 04:12:39 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[Encryption]]></category> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[Mail]]></category> <category><![CDATA[Spam]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=189</guid> <description><![CDATA[Dkimproxy is a great program for getting Postfix to both sign and validate DomainKeys and DKIM messages.   Prior to dkimproxy, one would have used dk-filter and dkim-filter which did DomainKeys and DKIM signing separately.  dkimproxy is a newer version that combines the functionality into one program.   Installing it can be [...]]]></description> <content:encoded><![CDATA[<p><a
href="http://dkimproxy.sourceforge.net/">Dkimproxy</a> is a great program for getting Postfix to both sign and validate DomainKeys and DKIM messages.   Prior to dkimproxy, one would have used dk-filter and dkim-filter which did DomainKeys and DKIM signing separately.  dkimproxy is a newer version that combines the functionality into one program.   Installing it can be a bit complicated because it isn&#8217;t available in most distro repositories, and requires several Perl modules that need to be installed.  Configuring it can be difficult as well, because it involves making changes DNS and postfix, in addition to its own configuration.</p><p>I wrote these steps below as I went through a recent installation for a customer</p><p>You can install the required Perl modules through the <a
href="http://dag.wieers.com/rpm/FAQ.php#B1">RPM Forge Repository</a> if you have it enabled with the command (Thanks JohnB for mentioning that):</p><pre>
yum install perl-Net-Server perl-Error perl-Mail-DKIM
</pre><p>Otherwise, you can install them manually with CPAN.  First install the openssl-devel package (You&#8217;ll need it for CPAN to install Mail::DKIM)</p><pre>yum install openssl-devel</pre><p>Now install the required Perl modules</p><pre># perl -MCPAN -e shell
&gt; install Net::Server
&gt; install Error
&gt; install Mail::DKIM</pre><p>Download and install the actual dkimproxy code:</p><pre>cd /usr/local/src
wget http://internap.dl.sourceforge.net/sourceforge/dkimproxy/dkimproxy-1.0.1.tar.gz
tar -xvzf dkimproxy-1.0.1.tar.gz
cd dkimproxy-1.0.1
./configure --prefix=/usr/local/dkimproxy
make
make install</pre><p>You should now have the program installed in /usr/local/dkimproxy.  A sample init file is included, so we can copy it into place also:</p><pre>cp /usr/local/src/dkimproxy-1.0.1/sample-dkim-init-script.sh /etc/init.d/dkimproxy</pre><p>Create a &#8216;dkim&#8217; user and group, but lock the password:</p><pre>useradd -d /usr/local/dkimproxy dkim
passwd -l dkim</pre><p>That should be enough to get dkimproxy running, but it isn&#8217;t configured yet.</p><p>Create a key file for your domain</p><pre>cd /usr/local/dkimproxy/etc/
openssl genrsa -out domain.tld.key 1024
openssl rsa -in domain.tld.key -pubout -out domain.tld.pub</pre><p>Now create a DNS TXT record for mail._domainkey.domain.tld with the contents of domain.tld.pub.  Your public key will span at least two lines, so combine all of the lines of the key together when putting it in your DNS record.  The whole DNS record will look something like this:</p><pre>k=rsa; t=s; p=MFwwDQYJ......0JMCAwEAAQ==</pre><p>(Note that the key is pretty long and I&#8217;ve shortened it here)<br
/> You could now confirm the key is correct in your DNS:</p><pre>[root@host etc]# host -ttxt mail._domainkey.domain.tls
mail._domainkey.domain.tld descriptive text "k=rsa\; t=s\; p=MFwwDQYJ......0JMCAwEAAQ=="
</pre><p>(Note that the key is pretty long and I&#8217;ve shortened it here)</p><p>Now tell dkimproxy about the key files, and configuration parameters. Create /usr/local/dkimproxy/etc/dkimproxy_out.conf with this content</p><pre>
# specify what address/port DKIMproxy should listen on
listen    127.0.0.1:10027

# specify what address/port DKIMproxy forwards mail to
relay     127.0.0.1:10028

# specify what domains DKIMproxy can sign for (comma-separated, no spaces)
domain    domain.tld

# specify what signatures to add
signature dkim(c=relaxed)
signature domainkeys(c=nofws)

# specify location of the private key
keyfile   /usr/local/dkimproxy/etc/domain.tld.key

# specify the selector (i.e. the name of the key record put in DNS)
selector  mail
</pre><p>And copy the sample inbound config to the real inbound config</p><pre>
cd /usr/local/dkimproxy/etc
cp dkimproxy_in.conf.example dkimproxy_in.conf
</pre><p>Now you should be able to start up dkimproxy, and configure it to start at boot:</p><pre>
/etc/init.d/dkimproxy start
chkconfig dkimproxy on
</pre><p>And the last step is just to modify the postfix configuration to tell it to forward messages sent to port 587 through dkimproxy for signing. I added these three sections to /etc/postfix/master.cf</p><pre>
### dkimproxy filter - see http://dkimproxy.sourceforge.net/postfix-outbound-howto.html
#
# modify the default submission service to specify a content filter
# and restrict it to local clients and SASL authenticated clients only
#
submission  inet  n     -       n       -       -       smtpd
    -o smtpd_etrn_restrictions=reject
    -o smtpd_sasl_auth_enable=yes
    -o content_filter=dksign:[127.0.0.1]:10027
    -o receive_override_options=no_address_mappings
    -o smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject

# specify the location of the DKIM signing proxy
# Note: the smtp_discard_ehlo_keywords option requires a recent version of
# Postfix. Leave it off if your version does not support it.
dksign    unix  -       -       n       -       10      smtp
    -o smtp_send_xforward_command=yes
    -o smtp_discard_ehlo_keywords=8bitmime,starttls

# service for accepting messages FROM the DKIM signing proxy
127.0.0.1:10028 inet  n  -      n       -       10      smtpd
    -o content_filter=
    -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
    -o smtpd_helo_restrictions=
    -o smtpd_client_restrictions=
    -o smtpd_sender_restrictions=
    -o smtpd_recipient_restrictions=permit_mynetworks,reject
    -o mynetworks=127.0.0.0/8
    -o smtpd_authorized_xforward_hosts=127.0.0.0/8
</pre><p>If you want it to sign messages sent from the command line sendmail program, modify the pickup service to use the content_filter like this:</p><pre>
pickup    fifo  n       -       n       60      1       pickup
    -o content_filter=dksign:[127.0.0.1]:10027
</pre><p>Finally restart postfix with &#8216;postfix reload&#8217;, and you *should* have a working installation.  You can now use my <a
href="http://www.brandonchecketts.com/emailtest.php">Domainkeys/Dkim validator</a> to test and ensure that it is working.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/getting-dkimproxy-installed-and-configured/feed</wfw:commentRss> <slash:comments>21</slash:comments> </item> <item><title>Identifying Weak SSL or SSH Keys on CentOS</title><link>http://www.brandonchecketts.com/archives/identifying-weak-ssl-or-ssh-keys-on-centos</link> <comments>http://www.brandonchecketts.com/archives/identifying-weak-ssl-or-ssh-keys-on-centos#comments</comments> <pubDate>Thu, 22 May 2008 21:13:15 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[Encryption]]></category> <category><![CDATA[General]]></category> <category><![CDATA[Linux System Administration]]></category> <category><![CDATA[Security]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/?p=185</guid> <description><![CDATA[With the Debian OpenSSL problems, everybody is wanting to know if their server is vulnerable to any attacks.  Fortunately, CentOS machines shouldn&#8217;t be directly affected and have fewer issues than if you are using Debian or Ubuntu derivatives.  Unfortunately though, your system may still be vulnerable if you have any users that may [...]]]></description> <content:encoded><![CDATA[<p>With the <a
href="http://lists.debian.org/debian-security-announce/2008/msg00152.html">Debian OpenSSL problems</a>, everybody is wanting to know if their server is vulnerable to any attacks.  Fortunately, CentOS machines shouldn&#8217;t be directly affected and have fewer issues than if you are using Debian or Ubuntu derivatives.  Unfortunately though, your system may still be vulnerable if you have any users that may have generated their keys on an affected machine.  So it is definitely necessary to check, even if you are not running a distribution that is affected.</p><p>This is the steps I have been going through to look for any weak keys on a CentOS server</p><p>Download the weak key detector provided by Debian (there may be better tools to use by now).  It is available on the <a
href="http://lists.debian.org/debian-security-announce/2008/msg00152.html">announcement page</a>.  (I&#8217;m not linking to it intentionally).</p><pre>
[root@host ~]# cd /tmp
[root@host tmp]# wget http://security.debian.org/project/extra/dowkd/dowkd.pl.gz
--20:44:31--  http://security.debian.org/project/extra/dowkd/dowkd.pl.gz
Resolving security.debian.org... 128.31.0.36, 130.89.175.54, 212.211.132.32, ...
Connecting to security.debian.org|128.31.0.36|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14231783 (14M) [application/x-gzip]
Saving to: `dowkd.pl.gz'

100%[================================>] 14,231,783  6.42M/s   in 2.1s

20:44:33 (6.42 MB/s) - `dowkd.pl.gz' saved [14231783/14231783]

[root@host tmp]# gunzip dowkd.pl.gz
</pre><p>Then check a couple known files &#8211; Start out with your SSH host keys in /etc/ssh/</p><pre>
[root@host tmp]# perl dowkd.pl file /etc/ssh/*key*
/etc/ssh/ssh_host_dsa_key:1: warning: unparsable line
/etc/ssh/ssh_host_key:1: warning: unparsable line
summary: keys found: 4, weak keys: 0
</pre><p>Then check any certificates in /etc/pki/tls:</p><pre>
[root@host tmp]# for file in `find /etc/pki/tls/ -name "*key"`; do echo -n "$file - "; perl /tmp/dowkd.pl file $file; done
/etc/pki/tls/certs/mydomain.ca.key - summary: keys found: 1, weak keys: 0
/etc/pki/tls/certs/secure.mydomain.ca.key - summary: keys found: 1, weak keys: 0
/etc/pki/tls/private/localhost.key - summary: keys found: 1, weak keys: 0
</pre><p>Any for any SSL certificates that Apache might be using in /etc/httpd/conf/ssl.key/:</p><pre>
[root@host tmp]# perl dowkd.pl  file /etc/httpd/conf/ssl.key/*
summary: keys found: 4, weak keys: 0
</pre><p>And finally, any users who might have authorized a weak key via their authorized_users file:</p><pre>
[root@host tmp]# for file in `find / -name authorized_keys`; do echo -n "$file "; perl dowkd.pl file $file; done
/home/someuser/.ssh/authorized_keys summary: keys found: 6, weak keys: 0
summary: keys found: 7, weak keys: 0
</pre><p>Note that any that say &#8216;warning: no blacklist found&#8217; means that the tool didn&#8217;t have a blacklist for the key type, so they might need to be checked with another tool unless you are sure that they are okay.</p><p>You should also check any other locations for keys.  The locations could vary widely on different machines, depending on the configuration of your server.  Those locations specified above should cover most of the default locations on a CentOS 4 or CentOS 5 server, but every server is different.   If you don&#8217;t find it now, its quite likely that an attacker will later.</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/identifying-weak-ssl-or-ssh-keys-on-centos/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>GnuPG Encryption with PHP</title><link>http://www.brandonchecketts.com/archives/gnupg-encryption-with-php</link> <comments>http://www.brandonchecketts.com/archives/gnupg-encryption-with-php#comments</comments> <pubDate>Wed, 27 Feb 2008 01:09:45 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[Encryption]]></category> <category><![CDATA[General]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category> <category><![CDATA[Security]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/archives/gnupg-encryption-with-php</guid> <description><![CDATA[I found PHP&#8217;s documentation on the GnuPG functions to be pretty sparse, so thought I would share some specific steps that I went though in order to get everything working.
Prerequisites
First off, you have to install the GnuPG PHP libraries through pecl.  It requires the GnuPG Made Easy (gpgme) packages to get working.  The [...]]]></description> <content:encoded><![CDATA[<p>I found PHP&#8217;s documentation on the <a
href="http://www.php.net/manual/en/ref.gnupg.php">GnuPG functions</a> to be pretty sparse, so thought I would share some specific steps that I went though in order to get everything working.</p><h1>Prerequisites</h1><p>First off, you have to install the GnuPG PHP libraries through pecl.  It requires the <a
href="http://www.gnupg.org/gpgme.html">GnuPG Made Easy</a> (gpgme) packages to get working.  The following shell commands will install the OS packages, install the GnuPG PHP libraries, then enable the PHP extension and restart Apache:</p><pre>
# apt-get install gnupg gpgme gpgme-devel

# pecl install gnupg

# echo extension=gnupg.so &gt; /etc/php.d/gnupg.ini

# apachectl restart</pre><h1>Creating GnuPG Keys</h1><p>Next, you need to create a set of keys to encrypt and decrypt your data.  You&#8217;ll need to put the keys somewhere where the webserver can read and write to a directory.  I&#8217;ll use /var/www/.gnupg since that is the default home directory for many Apache installations.   After running the gpg command, answer the questions as prompted. User input is red in the output shown below.</p><pre>
# mkdir -p /var/www/.gnupg

# gpg --homedir /var/www/.gnupg --gen-keygpg</pre><pre>WARNING: unsafe permissions on homedir `/tmp/keys'

gpg (GnuPG) 1.4.5; Copyright (C) 2006 Free Software Foundation, Inc.
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details.
gpg: keyring `/tmp/keys/secring.gpg' created
gpg: keyring `/tmp/keys/pubring.gpg' created
Please select what kind of key you want:
   (1) DSA and Elgamal (default)
   (2) DSA (sign only)
   (5) RSA (sign only)
Your selection? <span style="color: red; font-weight: bold">1</span>
DSA keypair will have 1024 bits.
ELG-E keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) <span style="color: red; font-weight: bold">2048</span>
Requested keysize is 2048 bits
Please specify how long the key should be valid.
         0 = key does not expire
      &lt;n&gt;  = key expires in n days
      &lt;n&gt;w = key expires in n weeks
      &lt;n&gt;m = key expires in n months
      &lt;n&gt;y = key expires in n years
Key is valid for? (0) <span style="color: red; font-weight: bold">10y</span>
Key expires at Fri Feb 23 16:35:14 2018 PST
Is this correct? (y/N) <span style="color: red; font-weight: bold">y</span>
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
    "Heinrich Heine (Der Dichter) &lt;heinrichh@duesseldorf.de&gt;"
Real name: <span style="color: red; font-weight: bold">Some User</span>
Email address: <span style="color: red; font-weight: bold">some@user.com</span>
Comment: <span color="yellow">This is a key for Some User</span>
You selected this USER-ID:
    "Some User (This is a key for Some User) &lt;some@user.com&gt;"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? <span style="color: red; font-weight: bold">o</span>
You need a Passphrase to protect your secret key. <span style="color: red; font-weight: bold">Enter your passphrase here</span>
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: /tmp/keys/trustdb.gpg: trustdb created
gpg: key 21CCC3D6 marked as ultimately trusted
public and secret key created and signed.
.... a bunch of random characters here....
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: next trustdb check due at 2018-02-24
pub   1024D/21CCC3D6 2008-02-27 [expires: 2018-02-24]
      Key fingerprint = <span style="color: green; font-weight: bold">FA45 1EE9 8772 70EF 1CFA  99CE 048A 6139 21CC C3D6</span>
uid                  Some User (This is a key for Some User) &lt;some@user.com&gt;
sub   2048g/A83E754B 2008-02-27 [expires: 2018-02-24]</pre><pre>#chown -R apache:apache /var/www/.gnupg</pre><p>Make note of the key fingerprint in the 4th from the bottom line.  You&#8217;ll need this in  your PHP code when referencing the key.   Also, make sure that you write down your pass phrase somewhere.   Your encrypted data will be useless if you don&#8217;t have the pass phrase.</p><h1>Your Application</h1><p>Now you can write your PHP code that will do the encryption.  Here is a sample that encrypts, then decrypts something:</p><pre>
&lt;?php
$CONFIG['gnupg_home'] = '/var/www/.gnupg';
$CONFIG['gnupg_fingerprint'] = 'FA451EE9877270EF1CFA99CE048A613921CCC3D6';

$data = 'this is some confidential information';

$gpg = new gnupg();
putenv("GNUPGHOME={$CONFIG['gnupg_home']}");
$gpg-&gt;seterrormode(GNUPG_ERROR_SILENT);
$gpg-&gt;addencryptkey($CONFIG['gnupg_fingerprint']);
$encrypted =  $this-&gt;gpg-&gt;encrypt($data);
echo "Encrypted text: \n&lt;pre&gt;$encrypted&lt;/pre&gt;\n";

// Now you can store $encrypted somewhere.. perhaps in a MySQL text or blob field.

// Then use something like this to decrypt the data.
$passphrase = 'Your_secret_passphrase';
$gpg-&gt;adddecryptkey($CONFIG['gnugp_fingerprint'], $passphrase);
$decrypted = $gpg-&gt;decrypt($encrypted);

echo "Decrypted text: $decrypted";
?&gt;</pre><p>It would be best to store $passphrase somewhere completely separate from your application configuration.  Perhaps an admin user would be required to enter the passphrase when looking up this information.  That way your passphrase is not stored in your config file or anywhere that an attacker could potentially gain access to it.</p><h1>Troubleshooting</h1><p>Make sure that the web server can write to the GnuPG Home directory.  This obviously is not ideal, but seems to be required in the testing that I have done.  I&#8217;ve been able to set &#8217;secring.gpg&#8217; to be owned by root, but that does little good since the directory it is in has to be writable.</p><p>You can raise the <a
href="http://www.php.net/manual/en/function.gnupg-seterrormode.php">error mode</a> to GNUPG_ERROR_WARNING to generate PHP warnings on GnuPG errors.  That might help to track down where errors are occurring</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/gnupg-encryption-with-php/feed</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>Database encryption made easy</title><link>http://www.brandonchecketts.com/archives/database-encryption-made-easy</link> <comments>http://www.brandonchecketts.com/archives/database-encryption-made-easy#comments</comments> <pubDate>Thu, 07 Dec 2006 20:28:29 +0000</pubDate> <dc:creator>Brandon</dc:creator> <category><![CDATA[Encryption]]></category> <category><![CDATA[Programming]]></category><guid
isPermaLink="false">http://www.brandonchecketts.com/blog/archives/10</guid> <description><![CDATA[I&#8217;ve always wondered how one would securely store sensitive information in a MySQL database.  A recent project has given me the opportunity to work on it, and I&#8217;ve been impressed on how easy it is to implement.   MySQL provides an easy interface for encrypting data before storing it in the database.  [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;ve always wondered how one would securely store sensitive information in a MySQL database.  A <a
href="http://www.chingas.bm/">recent project</a> has given me the opportunity to work on it, and I&#8217;ve been impressed on how easy it is to implement.   MySQL provides an easy interface for encrypting data before storing it in the database.  Simply use the AES_ENCRYPT and AES_DECRYPT functions when reading or writing to a table.</p><p>Simply make your column a blob field, then use something like this to write to the table</p><p>(using a PEAR::DB syntax)</p><pre>
$db-&gt;query("
UPDATE sometable
SET    some_col = AES_ENCRYPT( ?, ?)
WHERE something_else = ?
" array( $sensitive_value, $encryption_key, $index));
</pre><p>and something like this to read it back out</p><pre>
$value = $db-&gt;getOne("
SELECT AES_DECRYPT( some_col, ?)
FROM   sometable
WHERE something_else = ?
", array( $encryption_key, $index));
</pre><p>What could be easier?</p> ]]></content:encoded> <wfw:commentRss>http://www.brandonchecketts.com/archives/database-encryption-made-easy/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 3/12 queries in 0.010 seconds using disk

Served from: www.brandonchecketts.com @ 2010-09-08 08:05:16 -->