dbTalk Databases Forums  

Failure with DECRYPT_CHAR

comp.databases.informix comp.databases.informix


Discuss Failure with DECRYPT_CHAR in the comp.databases.informix forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ulf
 
Posts: n/a

Default Failure with DECRYPT_CHAR - 05-04-2011 , 06:53 AM






Version 11.50.FC7, HP-UX 11.31 ia64

I have run into a strange problem. I have two databases in the same
instance. I encrypt a column with ENCRYPT_AES in one of these and
decrypt it using DECRYPT_CHAR, no problem at all.

In the exact same table in the other database I do the ENCRYPT_AES,
this works OK, but when I try to decrypt I get


-26012 The internal base64 decoding function failed.

The internal crypto library base64 decoding API failed.
it may be caused by a corrupted data.

I have so far failed to understand this, I use the same SP to do the
encryption and the same to do the decryption, any idea to why I get
this error in the second database. The data that I encrypt is the
same.

Ulf

Reply With Quote
  #2  
Old   
Jonathan Leffler
 
Posts: n/a

Default Re: Failure with DECRYPT_CHAR - 05-04-2011 , 10:16 AM






On Wed, May 4, 2011 at 04:53, Ulf <ulf.akerberg (AT) gmail (DOT) com> wrote:

Quote:
Version 11.50.FC7, HP-UX 11.31 ia64

I have run into a strange problem. I have two databases in the same
instance. I encrypt a column with ENCRYPT_AES in one of these and
decrypt it using DECRYPT_CHAR, no problem at all.

In the exact same table in the other database I do the ENCRYPT_AES,
this works OK, but when I try to decrypt I get


-26012 The internal base64 decoding function failed.

The internal crypto library base64 decoding API failed.
it may be caused by a corrupted data.

I have so far failed to understand this, I use the same SP to do the
encryption and the same to do the decryption, any idea to why I get
this error in the second database. The data that I encrypt is the
same.

Are you quite sure that both tables have exactly the same lengths for the
encrypted column?

Can you see any length difference between the two encrypted (base-64
encoded) values?

There should be nothing to recognize from the base-64 encodings - they are
encrypted first - but the lengths should be the same.

What was the length of the data that was encrypted? What is the length of
the column you are storing it in?

--
Jonathan Leffler <jonathan.leffler (AT) gmail (DOT) com> #include <disclaimer.h>
Guardian of DBD::Informix - v2008.0513 - http://dbi.perl.org
"Blessed are we who can laugh at ourselves, for we shall never cease to be
amused."

Reply With Quote
  #3  
Old   
Ulf
 
Posts: n/a

Default Re: Failure with DECRYPT_CHAR - 05-05-2011 , 05:29 AM



Thanks Jonathan !

The problem was indeed the length of the column (and the way I
tested).

I increased the length of the encrypted column, ran a "select length
(encrypted column)" and found that for some data the original column
length was insufficient. It is a bit surprising how much more space
that is required, in this case a 20 char unencrypted column requires
67 characters encrypted.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.