Encrypting a field

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Encrypting a field

Post by admin »

Hi.

I need to encrypt a field, due to space reasons. This is a file that is the
direct debt for a credit card, and the layout of the file cannot be
changed. Within the record I have the Contract Account field, which has 10
positions, but really the data has 13 positions.

In order to be clear, I must store 13 numbers in 10 positions.

Any idea ?


Guillermo P. Barsky - gbarsky@osde.com.ar
Gerencia de Sistemas - Desarrollo

OSDE Binario - Filial Metropolitana
Alem 1067, Piso 16
(5411)4510-4330
http://www.osde.com.ar
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Encrypting a field

Post by admin »

Tony:

That is exactly what I though. But I don't know how to do it; I mean, I
have an idea but I don't know functions to help in this transform. So any
help on this subject will be appprecitted.

And yes, all are numbers from 0 to 9.


Guillermo P. Barsky - gbarsky@osde.com.ar
Gerencia de Sistemas - Desarrollo

OSDE Binario - Filial Metropolitana
Alem 1067, Piso 16
(5411)4510-4330
http://www.osde.com.ar



Tony Stark
cc:
Asunto: Re: Encrypting a field
05/12/2003 05:29
p.m.
Por favor, responda
a datastage-users






Guillermo,

Are these 13 characters always numeric? If so, you could encode two
characters into each byte. I'm not sure quite how to do that with datastage
basic, but I would look into the pack and unpack transforms used to read
mainframe type packed decimal fields.

hope this helps,
Tony

gbarsky@osde.com.ar wrote:




Hi.

I need to encrypt a field, due to space reasons. This is a file that is the
direct debt for a credit card, and the layout of the file cannot be
changed. Within the record I have the Contract Account field, which has 10
positions, but really the data has 13 positions.

In order to be clear, I must store 13 numbers in 10 positions.

Any idea ?


Guillermo P. Barsky - gbarsky@osde.com.ar
Gerencia de Sistemas - Desarrollo

OSDE Binario - Filial Metropolitana
Alem 1067, Piso 16
(5411)4510-4330
http://www.osde.com.ar


---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Encrypting a field

Post by admin »

Store the value in hex represented by ASCII, this is
probably the easiest solution.

Ex: FF = 256

You have two characters that can represent 3 in this
example.

So, FFFFFFFF = 4294967295

In this case, 8 characters represent 10.

Use your Windows calculator and flip numbers back and
forth between Hex and Dec mode to see how this works.
So, what you do, is convert your decimal to hex, but
store it in the textual representation as shown above.

-Ken


--- gbarsky@osde.com.ar wrote:
>
>
>
>
> Tony:
>
> That is exactly what I though. But I don't know how
> to do it; I mean, I
> have an idea but I don't know functions to help in
> this transform. So any
> help on this subject will be appprecitted.
>
> And yes, all are numbers from 0 to 9.
>
>
> Guillermo P. Barsky - gbarsky@osde.com.ar
> Gerencia de Sistemas - Desarrollo
>
> OSDE Binario - Filial Metropolitana
> Alem 1067, Piso 16
> (5411)4510-4330
> http://www.osde.com.ar
>
>
>
>
>
> Tony Stark
>
>
> datastage-users@oliver.com
>
> .com> cc:
>
>
>
> Asunto: Re: Encrypting a field
>
> 05/12/2003 05:29
>
>
> p.m.
>
>
> Por favor, responda
>
>
> a datastage-users
>
>
>
>
>
>
>
>
>
>
>
>
> Guillermo,
>
> Are these 13 characters always numeric? If so, you
> could encode two
> characters into each byte. I'm not sure quite how to
> do that with datastage
> basic, but I would look into the pack and unpack
> transforms used to read
> mainframe type packed decimal fields.
>
> hope this helps,
> Tony
>
> gbarsky@osde.com.ar wrote:
>
>
>
>
> Hi.
>
> I need to encrypt a field, due to space reasons.
> This is a file that is the
> direct debt for a credit card, and the layout of the
> file cannot be
> changed. Within the record I have the Contract
> Account field, which has 10
> positions, but really the data has 13 positions.
>
> In order to be clear, I must store 13 numbers in 10
> positions.
>
> Any idea ?
>
>
> Guillermo P. Barsky - gbarsky@osde.com.ar
> Gerencia de Sistemas - Desarrollo
>
> OSDE Binario - Filial Metropolitana
> Alem 1067, Piso 16
> (5411)4510-4330
> http://www.osde.com.ar
>
>
> ---------------------------------
> Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
>
>


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Encrypting a field

Post by admin »

Even easier, just store it in hexadecimal. The hex equivalent of 9999999999 is 540BE3FF (only eight characters).
To convert from decimal to hex, OCONV(decnumber, "MX")
To convert from hex to decimal, ICONV(hexnumber, "MX")

----- Original Message -----
From: Tony Stark
Date: Fri, 5 Dec 2003 12:29:13 -0800 (PST)
To: datastage-users@oliver.com
Subject: Re: Encrypting a field

> Guillermo,
>
> Are these 13 characters always numeric? If so, you could encode two characters into each byte. I'm not sure quite how to do that with datastage basic, but I would look into the pack and unpack transforms used to read mainframe type packed decimal fields.
>
> hope this helps,
> Tony
>
> gbarsky@osde.com.ar wrote:
>
>
>
>
> Hi.
>
> I need to encrypt a field, due to space reasons. This is a file that is the
> direct debt for a credit card, and the layout of the file cannot be
> changed. Within the record I have the Contract Account field, which has 10
> positions, but really the data has 13 positions.
>
> In order to be clear, I must store 13 numbers in 10 positions.
>
> Any idea ?
>
>
> Guillermo P. Barsky - gbarsky@osde.com.ar
> Gerencia de Sistemas - Desarrollo
>
> OSDE Binario - Filial Metropolitana
> Alem 1067, Piso 16
> (5411)4510-4330
> http://www.osde.com.ar
>
>
> ---------------------------------
> Do you Yahoo!?
Free Pop-Up Blocker - Get it now
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Encrypting a field

Post by admin »

Ray:

Thank you for your amswer, but I'm affraid that the my high value
9999999999999 needs 11 characteres to be represented in hexa. I need to
compress my 13 characteres into 10.

Thanks again.


Guillermo P. Barsky - gbarsky@osde.com.ar
Gerencia de Sistemas - Desarrollo

OSDE Binario - Filial Metropolitana
Alem 1067, Piso 16
(5411)4510-4330
http://www.osde.com.ar



"Ray Wurlod"
Para: datastage-users@oliver.com
cc:
05/12/2003 09:20 Asunto: Re: Encrypting a field
p.m.
Por favor, responda
a datastage-users






Even easier, just store it in hexadecimal. The hex equivalent of
9999999999 is 540BE3FF (only eight characters).
To convert from decimal to hex, OCONV(decnumber, "MX")
To convert from hex to decimal, ICONV(hexnumber, "MX")

----- Original Message -----
From: Tony Stark
Date: Fri, 5 Dec 2003 12:29:13 -0800 (PST)
To: datastage-users@oliver.com
Subject: Re: Encrypting a field

> Guillermo,
>
> Are these 13 characters always numeric? If so, you could encode two
characters into each byte. I'm not sure quite how to do that with datastage
basic, but I would look into the pack and unpack transforms used to read
mainframe type packed decimal fields.
>
> hope this helps,
> Tony
>
> gbarsky@osde.com.ar wrote:
>
>
>
>
> Hi.
>
> I need to encrypt a field, due to space reasons. This is a file that is
the
> direct debt for a credit card, and the layout of the file cannot be
> changed. Within the record I have the Contract Account field, which has
10
> positions, but really the data has 13 positions.
>
> In order to be clear, I must store 13 numbers in 10 positions.
>
> Any idea ?
>
>
> Guillermo P. Barsky - gbarsky@osde.com.ar
> Gerencia de Sistemas - Desarrollo
>
> OSDE Binario - Filial Metropolitana
> Alem 1067, Piso 16
> (5411)4510-4330
> http://www.osde.com.ar
>
>
> ---------------------------------
> Do you Yahoo!?
Free Pop-Up Blocker - Get it now
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Encrypting a field

Post by admin »

How about - given that you know that the decrypted values must be characters in the range 0-9, you store only the rightmost six bits of each? This will fit in your required 80 bit length (13 x 6 = 78). In binary "0" is 110000 and "9" is 111001. Check out the BITAND, SEQ and CHAR functions in BASIC.

----- Original Message -----
From: gbarsky@osde.com.ar
Date: Tue, 9 Dec 2003 11:00:37 -0300
To:
Subject: Re: Encrypting a field

>
>
>
>
> Ray:
>
> Thank you for your amswer, but I'm affraid that the my high value
> 9999999999999 needs 11 characteres to be represented in hexa. I need to
> compress my 13 characteres into 10.
>
> Thanks again.
>
>
> Guillermo P. Barsky - gbarsky@osde.com.ar
> Gerencia de Sistemas - Desarrollo
>
> OSDE Binario - Filial Metropolitana
> Alem 1067, Piso 16
> (5411)4510-4330
> http://www.osde.com.ar
>
>
>
> "Ray Wurlod"
> Para: datastage-users@oliver.com
> cc:
> 05/12/2003 09:20 Asunto: Re: Encrypting a field
> p.m.
> Por favor, responda
> a datastage-users
>
>
>
>
>
>
> Even easier, just store it in hexadecimal. The hex equivalent of
> 9999999999 is 540BE3FF (only eight characters).
> To convert from decimal to hex, OCONV(decnumber, "MX")
> To convert from hex to decimal, ICONV(hexnumber, "MX")
>
> ----- Original Message -----
> From: Tony Stark
> Date: Fri, 5 Dec 2003 12:29:13 -0800 (PST)
> To: datastage-users@oliver.com
> Subject: Re: Encrypting a field
>
> > Guillermo,
> >
> > Are these 13 characters always numeric? If so, you could encode two
> characters into each byte. I'm not sure quite how to do that with datastage
> basic, but I would look into the pack and unpack transforms used to read
> mainframe type packed decimal fields.
> >
> > hope this helps,
> > Tony
> >
> > gbarsky@osde.com.ar wrote:
> >
> >
> >
> >
> > Hi.
> >
> > I need to encrypt a field, due to space reasons. This is a file that is
> the
> > direct debt for a credit card, and the layout of the file cannot be
> > changed. Within the record I have the Contract Account field, which has
> 10
> > positions, but really the data has 13 positions.
> >
> > In order to be clear, I must store 13 numbers in 10 positions.
> >
> > Any idea ?
> >
> >
> > Guillermo P. Barsky - gbarsky@osde.com.ar
> > Gerencia de Sistemas - Desarrollo
> >
> > OSDE Binario - Filial Metropolitana
> > Alem 1067, Piso 16
> > (5411)4510-4330
> > http://www.osde.com.ar
> >
> >
> > ---------------------------------
> > Do you Yahoo!?
> Free Pop-Up Blocker - Get it now
>
>
>
<b>PLEASE READ</b>
Do not contact admin unless you have technical support or account questions. Do not send email or Private Messages about discussion topics to ADMIN. Contact the webmaster concerning abusive or offensive posts.
Locked