PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Password Encryption in DBlib
Date: Feb 21 2005 5:03PM

[ Please join the sybperl-l mailing list and post queries there - I
don't have the time anymore to answer individual requests...]

On Mon, 2005-02-21 at 06:47, Vijaya Chouta wrote:
> Hi Micheal,
> 
> I have the following function in one of my perl module files
> 
> sub Logon($$$$) 
> {
>         Sybase::DBlib::dbsetlogintime(300);
>         my($dbh);
>         $dbh = Sybase::DBlib->dblogin($_[0], $_[1], $_[2]);
>         if ($dbh >= 0)  {
>                 my($status) = $dbh -> dbuse($_[3]);
>         }
>         return($dbh);
> }
> 
> The above Logon function is called from one of my perl scripts as shown 
> below
> $DbHandle = Logon($user, $password, $server, $database);
> 
> I have been given a task to encrypt the above password. How do I achieve 
> this?

That depends on what you mean by "encrypt".

You can tell Sybase to encrypt the password before sending it to the
database server via the DBSETLENCRYPT() call, like this:

DBSETLENCRYPT(DBRUE);
$dbh = Sybase::DBlib->new(...);

If you mean "encrypt the password in the source", then it's a completely
different problem that Sybase::DBlib doesn't handle.

Michael
-- 
Michael Peppler  -  mpeppler@peppler.org  -  http://www.peppler.org/
Sybase DBA/Developer
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html