Problem solve Get help with specific problems with your technologies, process and projects.

Data encryption made easier

This tip shows you and easier way to encrypt data stored in your database

Do you want to encrypt data stored in your database? There is an easier way to this using the Cryptographic Technique. The sample program provided below explains data encryption and decryption. The encrypted value will be unique to the iSeries 400 machine.

The Sample programs can be used an encryptors and decryptors with a restriction that the length of the data to be encrypted should be multiple of eight.


 Data Encryption
=========
Pgm PARM (&Data)                      
Dcl VAR(&Data) TYPE(*Char) LEN(24)   
                                                
CphDta     DATA(&Data) DTALEN(24) CPHK(24) +
           RTNVAR(&Data) OPTION(*ECPH)      
                                        Return                                  

========        
Data DeCryption
=========
Pgm PARM (&Data)                      
Dcl VAR(&Data) TYPE(*Char) LEN(24)   
CPHDTA     DATA(&Data) DTALEN(24) CPHK(24) +
             RTNVAR(&Data) OPTION(*DCPH)    
Return 

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

Dig Deeper on iSeries CL programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close