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.

encrypt column

7 posts in General Discussion Last posting was on 2005-06-23 14:29:12.0Z
Rick Langel Posted on 2005-06-17 17:09:27.0Z
From: Rick Langel <langelrj@hotmail.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: encrypt column
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 170.54.59.167
Message-ID: <42b303c3$1@forums-2-dub>
X-Original-Trace: 17 Jun 2005 10:09:23 -0700, 170.54.59.167
Lines: 9
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 17 Jun 2005 10:09:26 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 17 Jun 2005 10:09:27 -0700
X-Trace: forums-1-dub 1119028167 10.22.108.75 (17 Jun 2005 10:09:27 -0700)
X-Original-Trace: 17 Jun 2005 10:09:27 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4567
Article PK: 8375

I'm using the ECRYPT function to encrpyt data with a key value, then
using the CAST and DECRYPT functions to get the data back. This all
works great until it runs into a column with an empty string as it's
value, then I get an error about needing an input string in 16 byte
form. Null values work the same way. Is there a workaround for this?
Has anyone else experienced the same behavior?

-Rick


Rick Langel Posted on 2005-06-17 17:13:34.0Z
From: Rick Langel <langelrj@hotmail.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: encrypt column
References: <42b303c3$1@forums-2-dub>
In-Reply-To: <42b303c3$1@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 170.54.59.167
Message-ID: <42b304b8$1@forums-2-dub>
X-Original-Trace: 17 Jun 2005 10:13:28 -0700, 170.54.59.167
Lines: 15
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 17 Jun 2005 10:13:31 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 17 Jun 2005 10:13:34 -0700
X-Trace: forums-1-dub 1119028414 10.22.108.75 (17 Jun 2005 10:13:34 -0700)
X-Original-Trace: 17 Jun 2005 10:13:34 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4568
Article PK: 8373

BTW, I'm using version 9.0.2.2451

Rick Langel wrote:
>
> I'm using the ECRYPT function to encrpyt data with a key value, then
> using the CAST and DECRYPT functions to get the data back. This all
> works great until it runs into a column with an empty string as it's
> value, then I get an error about needing an input string in 16 byte
> form. Null values work the same way. Is there a workaround for this?
> Has anyone else experienced the same behavior?
>
> -Rick


Rick Langel Posted on 2005-06-17 17:27:13.0Z
From: Rick Langel <langelrj@hotmail.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: encrypt column
References: <42b303c3$1@forums-2-dub> <42b304b8$1@forums-2-dub>
In-Reply-To: <42b304b8$1@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: 170.54.59.167
Message-ID: <42b307ed$1@forums-2-dub>
X-Original-Trace: 17 Jun 2005 10:27:09 -0700, 170.54.59.167
Lines: 23
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 17 Jun 2005 10:27:11 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 17 Jun 2005 10:27:13 -0700
X-Trace: forums-1-dub 1119029233 10.22.108.75 (17 Jun 2005 10:27:13 -0700)
X-Original-Trace: 17 Jun 2005 10:27:13 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4569
Article PK: 8374

And another clarification: I'm trying this in .Net. When I run the
same sql in iSql it works fine.

Rick Langel wrote:
>
> BTW, I'm using version 9.0.2.2451
>
>
> Rick Langel wrote:
>
>>
>> I'm using the ECRYPT function to encrpyt data with a key value, then
>> using the CAST and DECRYPT functions to get the data back. This all
>> works great until it runs into a column with an empty string as it's
>> value, then I get an error about needing an input string in 16 byte
>> form. Null values work the same way. Is there a workaround for this?
>> Has anyone else experienced the same behavior?
>>
>> -Rick
>
>


"Rob Waywell" <rwaywell Posted on 2005-06-22 17:41:20.0Z
From: "Rob Waywell" <rwaywell@no_spam.ianywhere.com>
Newsgroups: ianywhere.public.general
References: <42b303c3$1@forums-2-dub> <42b304b8$1@forums-2-dub> <42b307ed$1@forums-2-dub>
Subject: Re: encrypt column
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
X-Original-NNTP-Posting-Host: rwaywell-xp.sybase.com
Message-ID: <42b9a2bc$1@forums-2-dub>
X-Original-Trace: 22 Jun 2005 10:41:16 -0700, rwaywell-xp.sybase.com
X-Original-NNTP-Posting-Host: forums-2-dub.sybase.com
X-Original-Trace: 22 Jun 2005 10:41:17 -0700, forums-2-dub.sybase.com
NNTP-Posting-Host: forums-master.sybase.com
X-Original-NNTP-Posting-Host: forums-master.sybase.com
Date: 22 Jun 2005 10:41:20 -0700
X-Trace: forums-1-dub 1119462080 10.22.108.75 (22 Jun 2005 10:41:20 -0700)
X-Original-Trace: 22 Jun 2005 10:41:20 -0700, forums-master.sybase.com
X-Authenticated-User: ngsysop
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4578
Article PK: 8384

Can you post a snippet of code to show how you are executing this?
Are you getting a SQLCode in the error?
If so what is the SQLCode?
If not, then what is the error number - what does it look like?


--
-----------------------------------------------
Robert Waywell
Sybase Adaptive Server Anywhere Developer - Version 8
Sybase Certified Professional

Sybase's iAnywhere Solutions

Please respond ONLY to newsgroup

EBF's and Patches: http://downloads.sybase.com
choose SQL Anywhere Studio >> change 'time frame' to all

To Submit Bug Reports:
http://case-express.sybase.com/cx/cx.stm?starturl=casemessage.ssc?CASETYPE=Bug

SQL Anywhere Studio Supported Platforms and Support Status
http://my.sybase.com/detail?id=1002288

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer

"Rick Langel" <langelrj@hotmail.com> wrote in message
news:42b307ed$1@forums-2-dub...
>
> And another clarification: I'm trying this in .Net. When I run the same
> sql in iSql it works fine.
>
> Rick Langel wrote:
>>
>> BTW, I'm using version 9.0.2.2451
>>
>>
>> Rick Langel wrote:
>>
>>>
>>> I'm using the ECRYPT function to encrpyt data with a key value, then
>>> using the CAST and DECRYPT functions to get the data back. This all
>>> works great until it runs into a column with an empty string as it's
>>> value, then I get an error about needing an input string in 16 byte
>>> form. Null values work the same way. Is there a workaround for this?
>>> Has anyone else experienced the same behavior?
>>>
>>> -Rick
>>
>>
>


Rick Langel Posted on 2005-06-23 11:46:43.0Z
From: Rick Langel <langelrj@hotmail.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: encrypt column
References: <42b303c3$1@forums-2-dub> <42b304b8$1@forums-2-dub> <42b307ed$1@forums-2-dub> <42b9a2bc$1@forums-2-dub>
In-Reply-To: <42b9a2bc$1@forums-2-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 12-216-93-215.client.mchsi.com
X-Original-NNTP-Posting-Host: 12-216-93-215.client.mchsi.com
Message-ID: <42baa123$1@forums-1-dub>
Date: 23 Jun 2005 04:46:43 -0700
X-Trace: forums-1-dub 1119527203 12.216.93.215 (23 Jun 2005 04:46:43 -0700)
X-Original-Trace: 23 Jun 2005 04:46:43 -0700, 12-216-93-215.client.mchsi.com
Lines: 34
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4582
Article PK: 8386


Rob Waywell wrote:
> Can you post a snippet of code to show how you are executing this?
> Are you getting a SQLCode in the error?
> If so what is the SQLCode?
> If not, then what is the error number - what does it look like?

AsaConnection db = new
AsaConnection(@"dbf='EncryptTest.db';UID='DBA';PWD='SQL';");
db.Open();


string sql = "select CAST (DECRYPT(EncryptCol, 'abc123') AS CHAR(50)) as
EncryptCol from EncryptTable";


DataTable dt = new DataTable("test");
using(AsaDataAdapter adapter = new AsaDataAdapter(sql,db);) {
adapter.SelectCommand.CommandTimeout = 600;
try {
adapter.Fill(dt);
num = dt.Rows.Count;
}
catch (Exception ex) {
throw;
}
}



The exception message is "Decryption error: Input must be a multiple of
16 bytes in length for AES". I can't find the sqlcode property. How do
I get that? The internal NativeError property is -851.


Chris Keating (iAnywhere Solutions) Posted on 2005-06-23 13:09:44.0Z
From: "Chris Keating \(iAnywhere Solutions\)" <Spam_NoThanks_keating@iAnywhere.com>
Newsgroups: ianywhere.public.general
References: <42b303c3$1@forums-2-dub> <42b304b8$1@forums-2-dub> <42b307ed$1@forums-2-dub> <42b9a2bc$1@forums-2-dub> <42baa123$1@forums-1-dub>
Subject: Re: encrypt column
Lines: 56
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: keating-xp2.sybase.com
X-Original-NNTP-Posting-Host: keating-xp2.sybase.com
Message-ID: <42bab498$1@forums-1-dub>
Date: 23 Jun 2005 06:09:44 -0700
X-Trace: forums-1-dub 1119532184 10.25.98.199 (23 Jun 2005 06:09:44 -0700)
X-Original-Trace: 23 Jun 2005 06:09:44 -0700, keating-xp2.sybase.com
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4584
Article PK: 8390

I am unable to reproduce this in ASA 9.0.2.3131

If you continue to see this problem in a newer 9.0.2 EBF level, you should
contact Technical Support to get this issue resolved. Within North America,
you can reach Technical Support by calling 1-800-8SYBASE. If you are
located outside of North America, you can find the contact information for
your local Sybase Support Center by going to the Sybase home page at
ttp://www.sybase.com, clicking on the "Support" link at the top of the page,
and then choosing "Support Centers" from the left hand frame.

You can always report a bug for free by visiting CaseXpress at
http://casexpress.sybase.com/cx/cx.stm. When submitting calls through
CaseXpress,
please make sure to give an accurate description of the steps you take to
reproduce the bug, and include any files that may be needed (database,
source code) to reproduce the problem.

"Rick Langel" <langelrj@hotmail.com> wrote in message
news:42baa123$1@forums-1-dub...
> Rob Waywell wrote:
>> Can you post a snippet of code to show how you are executing this?
>> Are you getting a SQLCode in the error?
>> If so what is the SQLCode?
>> If not, then what is the error number - what does it look like?
>
>
>
> AsaConnection db = new
> AsaConnection(@"dbf='EncryptTest.db';UID='DBA';PWD='SQL';");
> db.Open();
>
>
> string sql = "select CAST (DECRYPT(EncryptCol, 'abc123') AS CHAR(50)) as
> EncryptCol from EncryptTable";
>
>
> DataTable dt = new DataTable("test");
> using(AsaDataAdapter adapter = new AsaDataAdapter(sql,db);) {
> adapter.SelectCommand.CommandTimeout = 600;
> try {
> adapter.Fill(dt);
> num = dt.Rows.Count;
> }
> catch (Exception ex) {
> throw;
> }
> }
>
>
>
> The exception message is "Decryption error: Input must be a multiple of 16
> bytes in length for AES". I can't find the sqlcode property. How do I
> get that? The internal NativeError property is -851.


Rick Langel Posted on 2005-06-23 14:29:12.0Z
From: Rick Langel <langelrj@hotmail.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: encrypt column
References: <42b303c3$1@forums-2-dub> <42b304b8$1@forums-2-dub> <42b307ed$1@forums-2-dub> <42b9a2bc$1@forums-2-dub> <42baa123$1@forums-1-dub> <42bab498$1@forums-1-dub>
In-Reply-To: <42bab498$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 170.54.59.167
X-Original-NNTP-Posting-Host: 170.54.59.167
Message-ID: <42bac738$1@forums-1-dub>
Date: 23 Jun 2005 07:29:12 -0700
X-Trace: forums-1-dub 1119536952 170.54.59.167 (23 Jun 2005 07:29:12 -0700)
X-Original-Trace: 23 Jun 2005 07:29:12 -0700, 170.54.59.167
Lines: 23
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4587
Article PK: 8392

Thanks for the reply.

Chris Keating (iAnywhere Solutions) wrote:
> I am unable to reproduce this in ASA 9.0.2.3131

That's a newer version than what I'm using, we haven't applied any EBFs
yet because we hadn't seen in any of the bug fix lists anything to do
with decryption.

> If you continue to see this problem in a newer 9.0.2 EBF level, you should
> contact Technical Support to get this issue resolved. Within North America,
> you can reach Technical Support by calling 1-800-8SYBASE. If you are
> located outside of North America, you can find the contact information for
> your local Sybase Support Center by going to the Sybase home page at
> ttp://www.sybase.com, clicking on the "Support" link at the top of the page,
> and then choosing "Support Centers" from the left hand frame.

Ya, we have a support contract, I just wanted to make sure that I wasn't
missing something simple before we submitted this to Sybase.

-Rick