Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Call Hash Dll ( ebcrypt & cryptlib)

5 posts in Appeon (partner product) Last posting was on 2006-01-13 04:12:42.0Z
mohaja Posted on 2006-01-05 13:53:55.0Z
Sender: 130d.43bd246b.1804289383@sybase.com
From: mohaja
Newsgroups: sybase.public.appeon
Subject: Call Hash Dll ( ebcrypt & cryptlib)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <43bd24f3.1314.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 5 Jan 2006 05:53:55 -0800
X-Trace: forums-1-dub 1136469235 10.22.241.41 (5 Jan 2006 05:53:55 -0800)
X-Original-Trace: 5 Jan 2006 05:53:55 -0800, 10.22.241.41
Lines: 77
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.appeon:1274
Article PK: 21120

Hi,

i am using cryptlib's CL32.DLL (http://cryptlib.sogot.de) in
my project to do a hash. I present an excerpt of my code.

// Using CryptLib CL32.DLL - My Local External.
Function long cryptInit () Library "CL32.DLL"
Function long cryptEnd () Library "CL32.DLL"
Function long cryptCreateContext (Ref long cryptContext,
long cryptUser, long cryptAlgo) Library "CL32.DLL"
Function long cryptDestroyContext (long cryptContext)
Library "CL32.DLL"
Function long cryptEncrypt (long cryptContext, string
buffer, long length) Library "CL32.DLL"
Function long cryptGetAttributeString (long cryptHandle,
long attributeType, ref string value, ref long valueLength)
Library "CL32.DLL"

// My code to hash.
long ll_context, ll_hashsize, ll_wordlen
string ls_hashword

cryptinit()
cryptcreatecontext( ll_context, crypt_unused, crypt_algo_sha
)
// crypt_unused = -11 , crypt_algo_sha = 203

ll_wordlen = len(trim(vs_word))
messagebox ("Word,Length", vs_word + " " + string(
ll_wordlen ))
cryptencrypt( ll_context , vs_word , ll_wordlen )
cryptencrypt( ll_context , "" , 0 )

ll_hashsize = crypt_max_hashsize // equal to 32
cryptgetattributestring(ll_context,crypt_ctxinfo_hashvalue,ls_hashword
, ll_hashsize )

cryptdestroycontext( ll_context )
cryptend()

messagebox ("HashLength", string( len( ls_hashword )) + " "
+ ls_hashword )

return misword2hex( ls_hashword )

This is basically what i did. The script runs successfully
on client/server but it does not giving any result after
deploy on Appeon 3.0 eventhough it pass the Analysis.
There's no error & the call return 0 - means success.

Actually, above is my 2nd try; my first try was using the
ebcrypt.dll (ebcrypt.com). The HashBLOB function works in
client/server but not in Appeon.

int mycallid, mycallid2
long li_return
String ls_return

oleobject myole
myole = create oleobject

li_return = myole.connecttonewobject("Ebcrypt.eb_c_Hash")
ls_return = myole.HashBLOB ( 1, blob(s_msg) )
myole.disconnectobject( )

return ls_return

The call success but return nothing because when i do a len,
it returns the length 0. I tried call other function which
is HashString; it returns a value but does not meet the spec
which is hash for 'abc' is
A9993E364706816ABA3E25717850C26C9CD0D89D

I hope Sybase can help me troubleshoot this problem because
its hard to when it pass the analyze.

Thanks in advance.


Julie Jiang Posted on 2006-01-06 14:30:59.0Z
From: "Julie Jiang" <julie.jiang@appeon.com>
Newsgroups: sybase.public.appeon
Organization: 218.17.72.209
References: <43bd24f3.1314.1681692777@sybase.com>
X-Newsreader: AspNNTP 1.50 (Takeshi Eto)
Subject: Re: Call Hash Dll ( ebcrypt & cryptlib)
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: web110.discountasp.net
X-Original-NNTP-Posting-Host: web110.discountasp.net
Message-ID: <43be7f23$1@forums-1-dub>
Date: 6 Jan 2006 06:30:59 -0800
X-Trace: forums-1-dub 1136557859 64.79.161.40 (6 Jan 2006 06:30:59 -0800)
X-Original-Trace: 6 Jan 2006 06:30:59 -0800, web110.discountasp.net
Lines: 99
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.appeon:1277
Article PK: 21117

We are still trying to reproduce the problem, at the same time, you please check
whether the following requiremens are met:

1) When your application calls an external function, it must be able to find the
DLL (Dynamic link library) or the shared library in which that function resides.
To ensure this, you must update the library path environment variable on the
client machine to include the directory where that DLL or shared library is
stored. The directory is searched in the following order of precedence:
1.Windows system directory
2. The Windows directory
3. The directories that are listed in the PATH environment variable.

2). You need to deploy the Image, DLL or OCX file with the application Web files
to the Web server. Refer to Section 4.2, Application profile configuration, in
the Appeon Developer User Guide for instructions.

Regards,
Julie

On 5 Jan 2006 05:53:55 -0800,
in sybase.public.appeon

<mohaja> wrote:
>Hi,
>
>i am using cryptlib's CL32.DLL (http://cryptlib.sogot.de) in
>my project to do a hash. I present an excerpt of my code.
>
>// Using CryptLib CL32.DLL - My Local External.
>Function long cryptInit () Library "CL32.DLL"
>Function long cryptEnd () Library "CL32.DLL"
>Function long cryptCreateContext (Ref long cryptContext,
>long cryptUser, long cryptAlgo) Library "CL32.DLL"
>Function long cryptDestroyContext (long cryptContext)
>Library "CL32.DLL"
>Function long cryptEncrypt (long cryptContext, string
>buffer, long length) Library "CL32.DLL"
>Function long cryptGetAttributeString (long cryptHandle,
>long attributeType, ref string value, ref long valueLength)
>Library "CL32.DLL"
>
>// My code to hash.
>long ll_context, ll_hashsize, ll_wordlen
>string ls_hashword
>
>cryptinit()
>cryptcreatecontext( ll_context, crypt_unused, crypt_algo_sha
>)
>// crypt_unused = -11 , crypt_algo_sha = 203
>
>ll_wordlen = len(trim(vs_word))
>messagebox ("Word,Length", vs_word + " " + string(
>ll_wordlen ))
>cryptencrypt( ll_context , vs_word , ll_wordlen )
>cryptencrypt( ll_context , "" , 0 )
>
>ll_hashsize = crypt_max_hashsize // equal to 32
>cryptgetattributestring(ll_context,crypt_ctxinfo_hashvalue,ls_hashword
>, ll_hashsize )
>
>cryptdestroycontext( ll_context )
>cryptend()
>
>messagebox ("HashLength", string( len( ls_hashword )) + " "
>+ ls_hashword )
>
>return misword2hex( ls_hashword )
>
>This is basically what i did. The script runs successfully
>on client/server but it does not giving any result after
>deploy on Appeon 3.0 eventhough it pass the Analysis.
>There's no error & the call return 0 - means success.
>
>Actually, above is my 2nd try; my first try was using the
>ebcrypt.dll (ebcrypt.com). The HashBLOB function works in
>client/server but not in Appeon.
>
>int mycallid, mycallid2
>long li_return
>String ls_return
>
>oleobject myole
>myole = create oleobject
>
>li_return = myole.connecttonewobject("Ebcrypt.eb_c_Hash")
>ls_return = myole.HashBLOB ( 1, blob(s_msg) )
>myole.disconnectobject( )
>
>return ls_return
>
>The call success but return nothing because when i do a len,
>it returns the length 0. I tried call other function which
>is HashString; it returns a value but does not meet the spec
>which is hash for 'abc' is
>A9993E364706816ABA3E25717850C26C9CD0D89D
>
>I hope Sybase can help me troubleshoot this problem because
>its hard to when it pass the analyze.
>
>Thanks in advance.


mohaja Posted on 2006-01-07 07:10:20.0Z
Sender: 2ef4.43bf68ee.1804289383@sybase.com
From: mohaja
Newsgroups: sybase.public.appeon
Subject: Re: Call Hash Dll ( ebcrypt & cryptlib)
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <43bf695c.2ef9.1681692777@sybase.com>
References: <43be7f23$1@forums-1-dub>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 6 Jan 2006 23:10:20 -0800
X-Trace: forums-1-dub 1136617820 10.22.241.41 (6 Jan 2006 23:10:20 -0800)
X-Original-Trace: 6 Jan 2006 23:10:20 -0800, 10.22.241.41
Lines: 152
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.appeon:1280
Article PK: 21121

Thanks Julie for the feedback. Anyway, i manage to call the
function following your instruction; include the DLL
(CL32.DLL) in the app. deployment profile. So calling the
function and make it work is settle.

FYI, the result from the function should be hex so i create
the function in PB as below:

lf_str2hex ( String vs_myword ) return string
integer i,j
long ll_wordlen
string ls_myword, ls_retstr
char lc_ret
integer ll_temp0, ll_temp1, li_asc, ii_pow

ll_wordlen = len( vs_myword )
messagebox("HashLen", string(ll_wordlen))

FOR i = 1 to ll_wordlen
li_asc = asc(mid(vs_myword,i,1))
for j = 1 to 0 step -1
ii_pow = 16^j
ll_temp0 = INT(abs(li_asc / ii_pow)) //For Appeon
ll_temp1 = ll_temp0 * ii_pow
IF ll_temp0 > 9 THEN
lc_ret = char(ll_temp0 + 55)
ELSE
lc_ret = char(ll_temp0 + 48)
END IF
li_asc -= ll_temp1
ls_retstr = ls_retstr + lc_ret
next
NEXT
return ls_retstr

This is the code after i adjust to make it runs on appeon.
Refer to the line 'For Appeon', initially it is ll_temp0 =
abs(li_asc / ii_pow), without INT in abc; why ? Because
ll_temp0 IS integer, so i assume there will be no decimal
when it assign to ll_temp0 and this function work in
client/server. But when i deploy the function to appeon,
this function returns something else, and after tracing i
found out that the number that is assign to ll_temp0 with
decimal number. So i have to INT(abs(li_asc / ii_pow))
before i pass it to ll_temp0. Is this a bug ? Hope this is
helpful to Sybase & other users as well.

By the way, i still have no luck with EBCrypt.DLL in appeon.

> We are still trying to reproduce the problem, at the same
> time, you please check whether the following requiremens
> are met:
>
> 1) When your application calls an external function, it
> must be able to find the DLL (Dynamic link library) or the
> shared library in which that function resides. To ensure
> this, you must update the library path environment
> variable on the client machine to include the directory
> where that DLL or shared library is stored. The directory
> is searched in the following order of precedence:
> 1.Windows system directory 2. The Windows directory
> 3. The directories that are listed in the PATH environment
> variable.
>
> 2). You need to deploy the Image, DLL or OCX file with the
> application Web files to the Web server. Refer to Section
> 4.2, Application profile configuration, in the Appeon
> Developer User Guide for instructions.
>
> Regards,
> Julie
>
> On 5 Jan 2006 05:53:55 -0800,
> in sybase.public.appeon
> <mohaja> wrote:
> >Hi,
> >
> >i am using cryptlib's CL32.DLL (http://cryptlib.sogot.de)
> in >my project to do a hash. I present an excerpt of my
> code. >
> >// Using CryptLib CL32.DLL - My Local External.
> >Function long cryptInit () Library "CL32.DLL"
> >Function long cryptEnd () Library "CL32.DLL"
> >Function long cryptCreateContext (Ref long cryptContext,
> >long cryptUser, long cryptAlgo) Library "CL32.DLL"
> >Function long cryptDestroyContext (long cryptContext)
> >Library "CL32.DLL"
> >Function long cryptEncrypt (long cryptContext, string
> >buffer, long length) Library "CL32.DLL"
> >Function long cryptGetAttributeString (long cryptHandle,
> >long attributeType, ref string value, ref long
> valueLength) >Library "CL32.DLL"
> >
> >// My code to hash.
> >long ll_context, ll_hashsize, ll_wordlen
> >string ls_hashword
> >
> >cryptinit()
> >cryptcreatecontext( ll_context, crypt_unused,
> crypt_algo_sha >)
> >// crypt_unused = -11 , crypt_algo_sha = 203
> >
> >ll_wordlen = len(trim(vs_word))
> >messagebox ("Word,Length", vs_word + " " + string(
> >ll_wordlen ))
> >cryptencrypt( ll_context , vs_word , ll_wordlen )
> >cryptencrypt( ll_context , "" , 0 )
> >
> >ll_hashsize = crypt_max_hashsize // equal to 32
> >cryptgetattributestring(ll_context
> ,crypt_ctxinfo_hashvalue,ls_hashword >, ll_hashsize )
> >
> >cryptdestroycontext( ll_context )
> >cryptend()
> >
> >messagebox ("HashLength", string( len( ls_hashword )) + "
> " >+ ls_hashword )
> >
> >return misword2hex( ls_hashword )
> >
> >This is basically what i did. The script runs
> successfully >on client/server but it does not giving any
> result after >deploy on Appeon 3.0 eventhough it pass the
> Analysis. >There's no error & the call return 0 - means
> success. >
> >Actually, above is my 2nd try; my first try was using the
> >ebcrypt.dll (ebcrypt.com). The HashBLOB function works in
> >client/server but not in Appeon.
> >
> >int mycallid, mycallid2
> >long li_return
> >String ls_return
> >
> >oleobject myole
> >myole = create oleobject
> >
> >li_return = myole.connecttonewobject("Ebcrypt.eb_c_Hash")
> >ls_return = myole.HashBLOB ( 1, blob(s_msg) )
> >myole.disconnectobject( )
> >
> >return ls_return
> >
> >The call success but return nothing because when i do a
> len, >it returns the length 0. I tried call other function
> which >is HashString; it returns a value but does not meet
> the spec >which is hash for 'abc' is
> >A9993E364706816ABA3E25717850C26C9CD0D89D
> >
> >I hope Sybase can help me troubleshoot this problem
> because >its hard to when it pass the analyze.
> >
> >Thanks in advance.


"Sally Li" <Appeon Technical support Posted on 2006-01-11 01:15:16.0Z
From: "Sally Li" <Appeon Technical support@appeon.com>
Newsgroups: sybase.public.appeon
References: <43be7f23$1@forums-1-dub> <43bf695c.2ef9.1681692777@sybase.com>
Subject: Re: Call Hash Dll ( ebcrypt & cryptlib)
Lines: 186
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 59.37.60.2
X-Original-NNTP-Posting-Host: 59.37.60.2
Message-ID: <43c45c24$1@forums-1-dub>
Date: 10 Jan 2006 17:15:16 -0800
X-Trace: forums-1-dub 1136942116 59.37.60.2 (10 Jan 2006 17:15:16 -0800)
X-Original-Trace: 10 Jan 2006 17:15:16 -0800, 59.37.60.2
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.appeon:1285
Article PK: 21122

Hi mohaja,

The difference is not caused by a bug. Hereinafter in abstracted from
Appeon Help, hope it helps in understanding the issue:
Expressions using the arithmetic operator “/” behave differently in
PowerBuilder than on the Web:

1) If a and b both take a long/integer value, the expression “a/b”
evaluates to a value rounded down in PowerBuilder, whereas on the Web it
evaluates to a value rounded up. For example:
Long ll_test
ll_test = 1/2
In PowerBuilder, ll_test evaluates to 0, but on the Web it evaluates to
1.

2) If a and b both take a long/integer value, if you form an arithmetic
expression that contains “a/b“ (a and b both take the long data type), the
entire expression evaluates to a value rounded down in PowerBuilder, whereas
on the Web, it evaluates to a value rounded up. For example:
Long ll_test 1
ll_test 1 = 9+1/2
In PowerBuilder, ll_test1 evaluates to 9, but on the Web it evaluates to
10.

As for the EBCRYPT.DLL issue, the problem was reproduced. Now we are
investegating what the cause is. I will let you know when there is any
progress.

Regards
Sally.li

<mohaja> wrote in message news:43bf695c.2ef9.1681692777@sybase.com...
> Thanks Julie for the feedback. Anyway, i manage to call the
> function following your instruction; include the DLL
> (CL32.DLL) in the app. deployment profile. So calling the
> function and make it work is settle.
>
> FYI, the result from the function should be hex so i create
> the function in PB as below:
>
> lf_str2hex ( String vs_myword ) return string
> integer i,j
> long ll_wordlen
> string ls_myword, ls_retstr
> char lc_ret
> integer ll_temp0, ll_temp1, li_asc, ii_pow
>
> ll_wordlen = len( vs_myword )
> messagebox("HashLen", string(ll_wordlen))
>
> FOR i = 1 to ll_wordlen
> li_asc = asc(mid(vs_myword,i,1))
> for j = 1 to 0 step -1
> ii_pow = 16^j
> ll_temp0 = INT(abs(li_asc / ii_pow)) //For Appeon
> ll_temp1 = ll_temp0 * ii_pow
> IF ll_temp0 > 9 THEN
> lc_ret = char(ll_temp0 + 55)
> ELSE
> lc_ret = char(ll_temp0 + 48)
> END IF
> li_asc -= ll_temp1
> ls_retstr = ls_retstr + lc_ret
> next
> NEXT
> return ls_retstr
>
> This is the code after i adjust to make it runs on appeon.
> Refer to the line 'For Appeon', initially it is ll_temp0 =
> abs(li_asc / ii_pow), without INT in abc; why ? Because
> ll_temp0 IS integer, so i assume there will be no decimal
> when it assign to ll_temp0 and this function work in
> client/server. But when i deploy the function to appeon,
> this function returns something else, and after tracing i
> found out that the number that is assign to ll_temp0 with
> decimal number. So i have to INT(abs(li_asc / ii_pow))
> before i pass it to ll_temp0. Is this a bug ? Hope this is
> helpful to Sybase & other users as well.
>
> By the way, i still have no luck with EBCrypt.DLL in appeon.
>
> > We are still trying to reproduce the problem, at the same
> > time, you please check whether the following requiremens
> > are met:
> >
> > 1) When your application calls an external function, it
> > must be able to find the DLL (Dynamic link library) or the
> > shared library in which that function resides. To ensure
> > this, you must update the library path environment
> > variable on the client machine to include the directory
> > where that DLL or shared library is stored. The directory
> > is searched in the following order of precedence:
> > 1.Windows system directory 2. The Windows directory
> > 3. The directories that are listed in the PATH environment
> > variable.
> >
> > 2). You need to deploy the Image, DLL or OCX file with the
> > application Web files to the Web server. Refer to Section
> > 4.2, Application profile configuration, in the Appeon
> > Developer User Guide for instructions.
> >
> > Regards,
> > Julie
> >
> > On 5 Jan 2006 05:53:55 -0800,
> > in sybase.public.appeon
> > <mohaja> wrote:
> > >Hi,
> > >
> > >i am using cryptlib's CL32.DLL (http://cryptlib.sogot.de)
> > in >my project to do a hash. I present an excerpt of my
> > code. >
> > >// Using CryptLib CL32.DLL - My Local External.
> > >Function long cryptInit () Library "CL32.DLL"
> > >Function long cryptEnd () Library "CL32.DLL"
> > >Function long cryptCreateContext (Ref long cryptContext,
> > >long cryptUser, long cryptAlgo) Library "CL32.DLL"
> > >Function long cryptDestroyContext (long cryptContext)
> > >Library "CL32.DLL"
> > >Function long cryptEncrypt (long cryptContext, string
> > >buffer, long length) Library "CL32.DLL"
> > >Function long cryptGetAttributeString (long cryptHandle,
> > >long attributeType, ref string value, ref long
> > valueLength) >Library "CL32.DLL"
> > >
> > >// My code to hash.
> > >long ll_context, ll_hashsize, ll_wordlen
> > >string ls_hashword
> > >
> > >cryptinit()
> > >cryptcreatecontext( ll_context, crypt_unused,
> > crypt_algo_sha >)
> > >// crypt_unused = -11 , crypt_algo_sha = 203
> > >
> > >ll_wordlen = len(trim(vs_word))
> > >messagebox ("Word,Length", vs_word + " " + string(
> > >ll_wordlen ))
> > >cryptencrypt( ll_context , vs_word , ll_wordlen )
> > >cryptencrypt( ll_context , "" , 0 )
> > >
> > >ll_hashsize = crypt_max_hashsize // equal to 32
> > >cryptgetattributestring(ll_context
> > ,crypt_ctxinfo_hashvalue,ls_hashword >, ll_hashsize )
> > >
> > >cryptdestroycontext( ll_context )
> > >cryptend()
> > >
> > >messagebox ("HashLength", string( len( ls_hashword )) + "
> > " >+ ls_hashword )
> > >
> > >return misword2hex( ls_hashword )
> > >
> > >This is basically what i did. The script runs
> > successfully >on client/server but it does not giving any
> > result after >deploy on Appeon 3.0 eventhough it pass the
> > Analysis. >There's no error & the call return 0 - means
> > success. >
> > >Actually, above is my 2nd try; my first try was using the
> > >ebcrypt.dll (ebcrypt.com). The HashBLOB function works in
> > >client/server but not in Appeon.
> > >
> > >int mycallid, mycallid2
> > >long li_return
> > >String ls_return
> > >
> > >oleobject myole
> > >myole = create oleobject
> > >
> > >li_return = myole.connecttonewobject("Ebcrypt.eb_c_Hash")
> > >ls_return = myole.HashBLOB ( 1, blob(s_msg) )
> > >myole.disconnectobject( )
> > >
> > >return ls_return
> > >
> > >The call success but return nothing because when i do a
> > len, >it returns the length 0. I tried call other function
> > which >is HashString; it returns a value but does not meet
> > the spec >which is hash for 'abc' is
> > >A9993E364706816ABA3E25717850C26C9CD0D89D
> > >
> > >I hope Sybase can help me troubleshoot this problem
> > because >its hard to when it pass the analyze.
> > >
> > >Thanks in advance.


"Sally Li" <Appeon Technical support Posted on 2006-01-13 04:12:42.0Z
From: "Sally Li" <Appeon Technical support@appeon.com>
Newsgroups: sybase.public.appeon
References: <43be7f23$1@forums-1-dub> <43bf695c.2ef9.1681692777@sybase.com> <43c45c24$1@forums-1-dub>
Subject: Re: Call Hash Dll ( ebcrypt & cryptlib)
Lines: 5371
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----=_NextPart_000_005A_01C61838.9FEB48F0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 59.37.60.2
X-Original-NNTP-Posting-Host: 59.37.60.2
Message-ID: <43c728ba@forums-1-dub>
Date: 12 Jan 2006 20:12:42 -0800
X-Trace: forums-1-dub 1137125562 59.37.60.2 (12 Jan 2006 20:12:42 -0800)
X-Original-Trace: 12 Jan 2006 20:12:42 -0800, 59.37.60.2
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub sybase.public.appeon:1289
Article PK: 21126

Hi Mohaja,
The EBCRYPT.DLL problem is caused by using a blob arguement in external
functions, which is an unsupported data type of the argument.

There are two options for you to work around this problem.
Option one: use the distributed NVOto work around this issue.
Step 1: Run and register the EBCRYPT.DLL on the EAServer machine.
Step 2: Encapsulate the function that calls the ebcrypt.dll to a NVO.
Step 3: Deploy theNVO to EAServer.
For detail information of using and deploying distributed NVO, please refer to the Section 5: Building and Migrating
Distributed Applications in the Appeon Migration Guide.
Attached isancode exmaple of the option one, you can take it as a reference.

Option two: use the HashString function to work around this issue.
As you mentioned, there is return value on the Web if you use the
HashString function. Actually the return value on the Web is the same as in
PowerBuilder.

Regards
Sally Li
"Sally Li" <Appeon Technical support@appeon.com> wrote in message news:43c45c24$1@forums-1-dub...
> Hi mohaja,
>
> The difference is not caused by a bug. Hereinafter in abstracted from
> Appeon Help, hope it helps in understanding the issue:
> Expressions using the arithmetic operator / behave differently in
> PowerBuilder than on the Web:
>
> 1) If a and b both take a long/integer value, the expression a/b
> evaluates to a value rounded down in PowerBuilder, whereas on the Web it
> evaluates to a value rounded up. For example:
> Long ll_test
> ll_test = 1/2
> In PowerBuilder, ll_test evaluates to 0, but on the Web it evaluates to
> 1.
>
> 2) If a and b both take a long/integer value, if you form an arithmetic
> expression that contains a/b (a and b both take the long data type), the
> entire expression evaluates to a value rounded down in PowerBuilder, whereas
> on the Web, it evaluates to a value rounded up. For example:
> Long ll_test 1
> ll_test 1 = 9+1/2
> In PowerBuilder, ll_test1 evaluates to 9, but on the Web it evaluates to
> 10.
>
> As for the EBCRYPT.DLL issue, the problem was reproduced. Now we are
> investegating what the cause is. I will let you know when there is any
> progress.
>
> Regards
> Sally.li
>
> <mohaja> wrote in message news:43bf695c.2ef9.1681692777@sybase.com...
> > Thanks Julie for the feedback. Anyway, i manage to call the
> > function following your instruction; include the DLL
> > (CL32.DLL) in the app. deployment profile. So calling the
> > function and make it work is settle.
> >
> > FYI, the result from the function should be hex so i create
> > the function in PB as below:
> >
> > lf_str2hex ( String vs_myword ) return string
> > integer i,j
> > long ll_wordlen
> > string ls_myword, ls_retstr
> > char lc_ret
> > integer ll_temp0, ll_temp1, li_asc, ii_pow
> >
> > ll_wordlen = len( vs_myword )
> > messagebox("HashLen", string(ll_wordlen))
> >
> > FOR i = 1 to ll_wordlen
> > li_asc = asc(mid(vs_myword,i,1))
> > for j = 1 to 0 step -1
> > ii_pow = 16^j
> > ll_temp0 = INT(abs(li_asc / ii_pow)) //For Appeon
> > ll_temp1 = ll_temp0 * ii_pow
> > IF ll_temp0 > 9 THEN
> > lc_ret = char(ll_temp0 + 55)
> > ELSE
> > lc_ret = char(ll_temp0 + 48)
> > END IF
> > li_asc -= ll_temp1
> > ls_retstr = ls_retstr + lc_ret
> > next
> > NEXT
> > return ls_retstr
> >
> > This is the code after i adjust to make it runs on appeon.
> > Refer to the line 'For Appeon', initially it is ll_temp0 =
> > abs(li_asc / ii_pow), without INT in abc; why ? Because
> > ll_temp0 IS integer, so i assume there will be no decimal
> > when it assign to ll_temp0 and this function work in
> > client/server. But when i deploy the function to appeon,
> > this function returns something else, and after tracing i
> > found out that the number that is assign to ll_temp0 with
> > decimal number. So i have to INT(abs(li_asc / ii_pow))
> > before i pass it to ll_temp0. Is this a bug ? Hope this is
> > helpful to Sybase & other users as well.
> >
> > By the way, i still have no luck with EBCrypt.DLL in appeon.
> >
> > > We are still trying to reproduce the problem, at the same
> > > time, you please check whether the following requiremens
> > > are met:
> > >
> > > 1) When your application calls an external function, it
> > > must be able to find the DLL (Dynamic link library) or the
> > > shared library in which that function resides. To ensure
> > > this, you must update the library path environment
> > > variable on the client machine to include the directory
> > > where that DLL or shared library is stored. The directory
> > > is searched in the following order of precedence:
> > > 1.Windows system directory 2. The Windows directory
> > > 3. The directories that are listed in the PATH environment
> > > variable.
> > >
> > > 2). You need to deploy the Image, DLL or OCX file with the
> > > application Web files to the Web server. Refer to Section
> > > 4.2, Application profile configuration, in the Appeon
> > > Developer User Guide for instructions.
> > >
> > > Regards,
> > > Julie
> > >
> > > On 5 Jan 2006 05:53:55 -0800,
> > > in sybase.public.appeon
> > > <mohaja> wrote:
> > > >Hi,
> > > >
> > > >i am using cryptlib's CL32.DLL (http://cryptlib.sogot.de)
> > > in >my project to do a hash. I present an excerpt of my
> > > code. >
> > > >// Using CryptLib CL32.DLL - My Local External.
> > > >Function long cryptInit () Library "CL32.DLL"
> > > >Function long cryptEnd () Library "CL32.DLL"
> > > >Function long cryptCreateContext (Ref long cryptContext,
> > > >long cryptUser, long cryptAlgo) Library "CL32.DLL"
> > > >Function long cryptDestroyContext (long cryptContext)
> > > >Library "CL32.DLL"
> > > >Function long cryptEncrypt (long cryptContext, string
> > > >buffer, long length) Library "CL32.DLL"
> > > >Function long cryptGetAttributeString (long cryptHandle,
> > > >long attributeType, ref string value, ref long
> > > valueLength) >Library "CL32.DLL"
> > > >
> > > >// My code to hash.
> > > >long ll_context, ll_hashsize, ll_wordlen
> > > >string ls_hashword
> > > >
> > > >cryptinit()
> > > >cryptcreatecontext( ll_context, crypt_unused,
> > > crypt_algo_sha >)
> > > >// crypt_unused = -11 , crypt_algo_sha = 203
> > > >
> > > >ll_wordlen = len(trim(vs_word))
> > > >messagebox ("Word,Length", vs_word + " " + string(
> > > >ll_wordlen ))
> > > >cryptencrypt( ll_context , vs_word , ll_wordlen )
> > > >cryptencrypt( ll_context , "" , 0 )
> > > >
> > > >ll_hashsize = crypt_max_hashsize // equal to 32
> > > >cryptgetattributestring(ll_context
> > > ,crypt_ctxinfo_hashvalue,ls_hashword >, ll_hashsize )
> > > >
> > > >cryptdestroycontext( ll_context )
> > > >cryptend()
> > > >
> > > >messagebox ("HashLength", string( len( ls_hashword )) + "
> > > " >+ ls_hashword )
> > > >
> > > >return misword2hex( ls_hashword )
> > > >
> > > >This is basically what i did. The script runs
> > > successfully >on client/server but it does not giving any
> > > result after >deploy on Appeon 3.0 eventhough it pass the
> > > Analysis. >There's no error & the call return 0 - means
> > > success. >
> > > >Actually, above is my 2nd try; my first try was using the
> > > >ebcrypt.dll (ebcrypt.com). The HashBLOB function works in
> > > >client/server but not in Appeon.
> > > >
> > > >int mycallid, mycallid2
> > > >long li_return
> > > >String ls_return
> > > >
> > > >oleobject myole
> > > >myole = create oleobject
> > > >
> > > >li_return = myole.connecttonewobject("Ebcrypt.eb_c_Hash")
> > > >ls_return = myole.HashBLOB ( 1, blob(s_msg) )
> > > >myole.disconnectobject( )
> > > >
> > > >return ls_return
> > > >
> > > >The call success but return nothing because when i do a
> > > len, >it returns the length 0. I tried call other function
> > > which >is HashString; it returns a value but does not meet
> > > the spec >which is hash for 'abc' is
> > > >A9993E364706816ABA3E25717850C26C9CD0D89D
> > > >
> > > >I hope Sybase can help me troubleshoot this problem
> > > because >its hard to when it pass the analyze.
> > > >
> > > >Thanks in advance.
>
>