Re: Password Encryption in DBlib

Michael Peppler <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
[ 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  -  [email protected]  -  http://www.peppler.org/
Sybase DBA/Developer
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.