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 MBAY dot NET>
Subject: Secure login using sybperl
Date: Nov 25 1998 10:46PM

Natarajan (Ravi) Murugaiyan writes:
 > 
 > 
 > It is possible to open a connection to SQL server using encrypted password 
 > by calling DBSETLENCRYPT from DB library. How can I accomplish the same thing 
 > from Sybase::DBlib?

DBSETLENCRYPT() is not implemented in Sybase::DBlib, but it's trivial:

int
DBSETLENCYPT(enable)
	int	enable
CODE:
{
    RETVAL = DBSETLENRCYPT(login, enable);
}
OUTPUT:
RETVAL

This code needs to be put in DBlib.xs somewhere (look for where the
other DBSETLxxx() functions/macros are defined)


 > Does CTlib by default send password encrypted to the server?
 > If not, what Sybase::CTlib calls do I need to make to encrypt
 > the password?

This can be done by passing CS_SEC_ENCRYPTION attribute to the
new/ct_connect call as described in the sybperl manual:

             To set the connection properties you pass a special
             hash in the attributes parameter:

                     $dbh = new Sybase::CTlib 'user', 'pwd', 'SYBASE', undef,
                                { CON_PROPS => { CS_HOSTNAME => 'kiruna',
                                                 CS_PACKETSIZE => 1024,
                                                 CS_SEC_CHALLENGE => CS_TRUE }
                                };


So you would do:

         $dbh = new Sybase::CTlib 'user', 'pwd', 'SYBASE', undef,
                        { CON_PROPS => { CS_SEC_ENCRYPT => CS_TRUE }
                        };

to enable password encryption at login time.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@mbay.net       -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com