Thread: Encrypt data type LO

Encrypt data type LO

From
"Alberto Piña"
Date:
<div class="Section1"><p class="MsoNormal"><font face="Verdana" size="2"><span lang="EN-US" style="font-size:
10.0pt;font-family:Verdana">Hi fellows, I need to encrypt fields of data type LO (LO is included in the contrib section
ofPostgreSQL) and I don’t know if pgcrypto is the way to do that or there is another way.  If anyone knows the answer
ofmy problem or know an alternative way to do this, I’ll appreciate you can share this with me.</span></font><p
class="MsoNormal"><fontface="Verdana" size="2"><span style="font-size:10.0pt; 
font-family:Verdana">Regards.</span></font><p class="MsoNormal"><font face="Verdana" size="2"><span
style="font-size:10.0pt;
font-family:Verdana"> </span></font><p class="MsoNormal"><font face="Verdana" size="2"><span style="font-size:10.0pt;
font-family:Verdana">Ing. Carlos Alberto Piña Uribe</span></font><p class="MsoNormal"><font face="Verdana"
size="2"><spanstyle="font-size:10.0pt; 
font-family:Verdana">Consultoría y Desarrollo</span></font><p class="MsoNormal"><font face="Verdana" size="2"><span
style="font-size:10.0pt;
font-family:Verdana">KEBIR Infraestructura Tecnológica</span></font><p class="MsoNormal"><font color="black"
face="Verdana"size="2"><span style="font-size:10.0pt;font-family:Verdana;color:black"><a
href="mailto:alberto.pina@kebir.com.mx"
title="mailto:alberto.pina@kebir.com.mx">alberto.pina@kebir.com.mx</a></span></font><pclass="MsoNormal"><font
face="TimesNew Roman" size="3"><span style="font-size: 
12.0pt"> </span></font></div>

Re: Encrypt data type LO

From
James Robinson
Date:
We do all of our encryption in the middleware:
1) translate our data which requires encryption into an XML string2) compress + encrypt, yielding byte [].3) Store byte
[]as a bytea column.
 

The resulting byte arrays are relatively small in our case (1 -> 3K), 
so bytea has seemed to suit us just fine.

----
James Robinson
Socialserve.com