The IBM utility IDCAMS can encrypt and decrypt data sets. The key to be used can be provided as parameter or through a separate DD statement.
1 - Key provided as parameter
Encryption
//ENCRYPT EXEC PGM=IDCAMS
//SYSIN DD *
REPRO IFILE(IN01) -
OFILE(OT01) -
ENCIPHER( PRIVATEKEY -
DATAKEYVALUE('ABCDEFGJ') -
)
//IN01 DD *
RECORD 1
RECORD 2
RECORD 3
/*
//OT01 DD SYSOUT=*,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=27920)
//SYSPRINT DD SYSOUT=*
Decryption
//DECRYPT EXEC PGM=IDCAMS,
// COND=(0,LT)
//SYSIN DD *
REPRO IFILE(IN01) -
OFILE(OT01) -
DECIPHER( DATAKEYVALUE('ABCDEFGJ') )
/*
//IN01 DD DSN=enciphered dataset,
// DISP=SHR
//OT01 DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
2 - Key provided through DD statement
Encryption
//ENCRYPT EXEC PGM=IDCAMS
//SYSIN DD *
REPRO IFILE(IN01) -
OFILE(OT01) -
ENCIPHER( PRIVATEKEY -
DATAKEYFILE(KEY) -
)
//KEY DD *
C1C2C3C4C5C6D1
/*
//IN01 DD *
RECORD 1
RECORD 2
RECORD 3
/*
//OT01 DD SYSOUT=*,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=27920)
//SYSPRINT DD SYSOUT=*
Decryption
//DECRYPT EXEC PGM=IDCAMS,
// COND=(0,LT)
//SYSIN DD *
REPRO IFILE(IN01) -
OFILE(OT01) -
DECIPHER( DATAKEYFILE(KEY) )
/*
//KEY DD *
C1C2C3C4C5C6D1
/*
//IN01 DD DSN=enciphered dataset,
// DISP=SHR
//OT01 DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
2011年9月3日 星期六
IBM utility IDCAMS can encrypt and decrypt data sets
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言