| Server IP : 216.92.14.13 / Your IP : 216.73.216.171 Web Server : Apache System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 User : rmlac2fmr ( 1040637) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/local/man/man3/ |
Upload File : |
.\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.29)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" Set up some character translations and predefined strings. \*(-- will
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
.\" double quote, and \*(R" will give a right double quote. \*(C+ will
.\" give a nicer C++. Capital omega is used to do unbreakable dashes and
.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
.\" nothing in troff, for use with C<>.
.tr \(*W-
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{\
. ds -- \(*W-
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el\{\
. ds -- \|\(em\|
. ds PI \(*p
. ds L" ``
. ds R" ''
. ds C`
. ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\"
.\" If the F register is turned on, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD. Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{
. if \nF \{
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
..
. if !\nF==2 \{
. nr % 0
. nr F 2
. \}
. \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "xDBM_File 3"
.TH xDBM_File 3 "2008-01-03" "perl v5.22.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH "NAME"
Crypt::xDBM_File \- encrypt almost any kind of dbm file
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
.Vb 5
\& use Crypt::xDBM_File;
\& use GDBM_File; # remember to only load those you really want
\& use SDBM_File;
\& use NDBM_File;
\& use Fcntl; # neede by SDBM_File and NDBM_File
\&
\& tie %hash, \*(AqCrypt::xDBM_File\*(Aq, crypt_method, key, \*(AqGDBM_FILE\*(Aq, $filename, &GDBM_WRCREAT, 0640;
\&
\& tie %hash, \*(AqCrypt::xDBM_File\*(Aq, \*(AqIDEA\*(Aq, "my_key", \*(AqNDBM_FILE\*(Aq, $filename, O_RDWR|O_CREAT, 0640;
\&
\& tie %hash, \*(AqCrypt::xDBM_File\*(Aq, \*(AqDES\*(Aq, "my_key", \*(AqSDBM_FILE\*(Aq, $filename, O_RDWR|O_CREAT, 0640;
\&
\& tie %hash, \*(AqCrypt::xDBM_File\*(Aq, \*(AqCrypt::Blowfish\*(Aq, "my key", \*(AqGDBM_FILE\*(Aq, $filename, &GDBM_WRCREAT, 0640;
.Ve
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
Crypt::xDBM_File encrypts/decrypts the data in a gdbm,ndbm,sdbm (and maybe even berkeleyDB, but I didn't test that) file. It gets tied to a hash and you just access the hash like normal. The crypt function can be any of the \s-1CPAN\s0 modules that use encrypt, decrypt, keysize, blocksize (so Crypt::IDEA, Crypt::DES, Crypt::Blowfish, ... should all work)
.PP
You can in a single dbm file mix encryption methods, just be prepared to handle the binary muck that you get from trying to decrypt with an algorithm different from the one a key was originally encrypted in (for example if you do a keys or values, you'll get all of the keys regardless of who encrypted them).
.PP
***IMPORTANT***
Encryption keys (the key you pass in on the tie line) will be padded or truncated to fit the \fIkeysize()\fR. Data (the key/values of the hash) is padded to fill complete blocks of \fIblocksize()\fR. The padding is stripped before being returned to the user so you shouldn't need to worry about it (except truncated keys). Read the doc that comes with crypt function to get an idea of what these sizes are. If keysize or blocksize returns a zero the default is set to 8 bytes (64 bits).
.SH "AUTHOR"
.IX Header "AUTHOR"
Eric Estabrooks, eric@urbanrage.com
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fIperl\fR\|(1).