TAA Tools
SCRAMBLE      SCRAMBLE BYTES WITHIN A FIELD        TAACLPF

The  SCRAMBLE  command  scrambles  or  unscrambles  bytes  in  a  field
according  to a  scramble  code field  passed  with the  command.   The
SCRAMBLE command is useful when masking data.

Scrambling  means  that byte  1  of the  data  becomes byte  3,  byte 2
becomes byte  7 etc.   The scramble  code field passed  as a  parameter
allows the scrambling algorithm to vary.

Command parameters                                    *CMD
------------------

   INPUT         The  variable   to  be  scrambled.    It   must  be  a
                 character variable of length 256.

   OUTPUT        The  output variable which contains  the result of the
                 scramble.  It must be  a character variable of  length
                 256.

   PROCESS       The    process   operation    (either   scramble    or
                 unscramble)  to  be performed.   This  is  a character
                 variable of  length  4  which  can  only  contain  the
                 values *SCR or *UNS.

   LEN           This must  be a  decimal variable  of LEN(3  0).   The
                 value controls  the number of characters  in the field
                 to  be  scrambled.    The values  in  the  INPUT field
                 should be  left adjusted.   The  command assumes  that
                 if you have  a 10 byte input field that  you want a 10
                 byte  scrambled output  field.   The command  does not
                 scramble into a larger size field.

   SCRCDE        The scramble code  that controls  how the scramble  is
                 to be performed.   It must be a  character variable of
                 length 10.   Any characters (including  lower case and
                 unprintable characters) are valid.

The processing program  (TAACLPFR) can  be called  directly instead  of
using the  command.   The parameter  list is  the same as  that on  the
command.

If you  scramble the data, you  must use the same  SCRCDE to unscramble
the  data.   The  SCRCDE parameter  allows you  to vary  the scrambling
function based  on  some  other data.    For  example, if  you  have  a
payroll  record with a  key of  USER and  the value  of the  USER field
does not  change, it could be used as  the SCRCDE value to scramble the
SALARY field.  Thus two users  with the same salary would not have  the
same  sequence  of data  in  the  field.    This is  a  better  masking
technique  than always using  the same  scramble code for  every record
in the file.

The command is written so the  processing program is not ended when  it
is invoked (i.e.  LR  is not set on when the command  completes).  This
allows faster  performance when the  command is used  multiple times in
succession.    When  you  are finished  with  the  command,  you should
either use the FREE operation  within RPG or the RCLRSC command  to get
rid of the programs storage.

Restrictions
------------

None.

Prerequisites
-------------

None.

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

   Object        Type       Attribute      Src member     Src file
   ------        -----      ---------      ----------     -----------

   SCRAMBLE      *CMD                      TAACLPF        QATTCMD
   TAACLPFR      *PGM          RPG         TAACLPFR       QATTRPG
					

Added to TAA Productivity tools April 1, 1995


Home Page Up to Top