support: Customer Portal
Focused on delivering choice, investment protection and flexibility to organizations with valuable COBOL assets
 

Veryant Knowledge Base
Home > All Categories > Data Access > Did you know you can encrypt an indexed file?
Question Title Did you know you can encrypt an indexed file?

With isCOBOL it's possible to encrypt an indexed file.
Encryption of indexed files is supported by the following file systems:

- JISAM
- CTREEJ

It's possible to mix encrypted file with non encrypted files, as needed.
Below you can find the instructions to activate encryption for each file system.


JISAM

To activate encryption on a file when using JISAM, you need to add the "with encryption" clause to the SELECT statement of the file, after the "organization" clause.
For example change the select statement from

       select FILE1 assign to "IndexedFile"
           organization indexed
           access dynamic
           record key f1-key
           status file-status
           .
to
       select FILE1 assign to "IndexedFile"
           organization indexed
           WITH ENCRYPTION
           access dynamic
           record key f1-key
           status file-status
           .
You then need to specify the encryption key by adding the following configuration property
iscobol.file.encryption.key=your-key

The configuration property must be set to a value different from spaces, otherwise a file mismatch error is raised. The encryption key can be up to 16 characters long. The Blowfish algorithm is used to encrypt data. If an encrypted file is opened for input or i-o with the wrong encryption key, then a file corrupt error is raised. If the encryption key is not set in the configuration, opening an encrypted file produces a 9X status.
To encrypt an existing file, the file must be converted. The simplest way to encrypt a file is using the ISMIGRATE utility.

Select JISAM for "From" and "To" file system

Press Next
Select the file to encrypt

And press next

Select the destination folder and make sure the "Enable encryption" check-box is set and specify the encryption key, which must be the same value in the configuration property iscobol.file.encryption.key. Follow the wizard steps.
Now you have the encrypted version of the file.
When using utilities that access an encrypted indexed file, the encryption key must be passed either in the command line, where supported, or in the configuration file.

CTREEJ

C-ctree can handle encryption without any code change, but just needs configuration changes.
iscobol configuration file or ctree-conf configuration file can be used to control encryption settings.
The isCOBOL configuration is only used by cobol programs or isCOBOL utilities, while the ctree-conf configuration file is used by isCOBOL programs and the c-tree utilities.

isCOBOL configuration

Use the following configuration properties to configure encryption:

iscobol.file.index.encrypt=1
With this property every file is encrypted.
To encrypt only the selected file, an instance of c-tree must be created by adding the following property
iscobol.file.index.maxinstance=2
The value must reflect the number of instances created by c-tree. In this case it is 2 because there is the default instance (instance 0) and the encrypted instance (instance 1).
iscobol.file.index.1.server=FAIRCOMS@127.0.0.1
Is the definition of instance 1 (encrypted instance), the server can be the same as the default instance. The settings of instance 0 (default instance) is omitted in this sample since the defaults are used.
iscobol.file.index.1.file_mapping=IndexedFile1
Is the list of the file included into the instance 1. Multiple names must be separated by commas. Wildcards are supported. The files not included in this list will use instance 0
iscobol.file.index.1.encrypt=1
Activate encryption on instance 1

C-tree conf

In your configuration file add the following configuration property
iscobol.ctree.new_config=0
and configure the ctree.conf file as below to encrypt all files
<config>
   <instance server="FAIRCOMS@127.0.0.1" connect="no">
      <encrypt>yes</encrypt>
   </instance>
</config>
Or use the configuration below to encrypt a single file
<config>
   <instance server="FAIRCOMS@127.0.0.1" connect="no">
      <file name="IndexedFile1">
         <encrypt>yes</encrypt>
      </file>
   </instance>
</config>
To encrypt an existing file, the file must be converted.
The simplest way to encrypt a file is using the command line version of the ISMIGRATE utility.
First create a specific configuration file with the following properties
iscobol.file.index.encrypt=1
iscobol.ismigrate_no_directories=1
iscobol.ismigrate_input_file_index=ctreej
iscobol.ismigrate_output_file_index=ctreej
and use the following command line statements
iscmigrate c:/encryption/test/IndexFile1 c:/encryption/test/encrypted/IndexFile1
Authored by: Veryant Support This question has been viewed 413 times so far.
Click Here to View all the questions in Data Access category.
File Attachments File Attachments
There are no attachment file(s) related to this question.
How helpful was this article to you?
User Comments User Comments Add Comment
There are no user comments for this question. Be the first to post a comment. Click Here
Related Questions Related Questions
  1. File Types Comparison : isCOBOL - Micro Focus COBOL - ACUCOBOL-GT - RM/COBOL
  2. How do I interpret file status 9? and other EXFS extended file status codes (e.g. 9i,105)?
  3. What format does isCOBOL use for ORGANIZATION RELATIVE files?
  4. What is 9l,10 error and why is it happening?
  5. Does isCOBOL supports Data General file status codes?
  6. Can we use Micro Focus data format and indexed files directly or do they need some type of conversion?
  7. Can I install the UDBC 32 bit on my 64 bit computer in order to have the Veryant * driver for ODBC32 bits Administrator?
  8. Why do I get the error message “java.lang.ClassNotFoundException: ctree2" ?
  9. Can I call from an isCobol program a stored procedure?
  10. Why do I get 'ct_init ERROR 19:133:0' ?
  11. Did you know you can use an alias to map a different disk file name to an existing &quot;assign to&quot; clause of the select statement without source code changes?
Article Information Additional Information
Article Number: 291
Created: 2018-04-17 2:54 AM
Rating: No Rating
 
Article Options Article Options
Print Question Print this Question
Email Question Email Question to Friend
Export to Adobe PDF Export to PDF File
Export to MS Word Export to MS Word
Bookmark Article
Subscribe to Article Subscribe to Article
 
Search Knowledge Base Search Knowledge Base



 
 

© Veryant - All Rights Reserved
Veryant and isCOBOL are trademarks or registered marks of Veryant in the United States and other countries. All other marks are the property of their respective owners.