Home

Communication Horizons
established 1986

Home
Contact

 

Knowledgebase Index
About Us
Contact
Legacy Products


Communication Horizons
65 High Ridge Rd. #428
Stamford CT 06905

support

800-480-1604
203-321-1278
fax  286-1056

       

Knowledgebase


>>ITEM: N00105

>>DATE: 08/26/96

>>TYPE: Information

>>TITLE: Encrypted file becomes decrypted after PACK or REINDEX

>>PRODUCT(S): Netlib 6.5x for Clipper
NetLib 2.0x for FoxPro DOS
NetLib 2.0x for FoxPro Windows

>>PLATFORMS(S): All

>>SUMMARY:
An encrypted DBF may "mysteriously" become decrypted after a PACK operation, or an encrypted index file may become decrypted after a PACK or REINDEX operation.

>>MORE INFORMATION:
FoxPro and Clipper PACK with the following internal procedure:

  1. COPY TO "temp.dbf" FOR .NOT. DELETED()
  2. DELETE "original.dbf"
  3. RENAME "temp.dbf" TO "original.dbf"
NetLib does not normally encrypt newly created files. Therefore, in the above operation, temp.dbf is created as an unencrypted file, even if original.dbf was encrypted.

>>RESOLUTION/FIX:
Use N_ENCODENEW(.T.) whenever performing file operations that may use intermediate temporary work files. This includes (but may not be limited to) PACK, INDEX ON and REINDEX. N_ENCODENEW(.T.) instructs NetLib to automatically encrypted newly created files.

IMPORTANT:
Only specify N_ENCODENEW(.T.) when needed. Immediately turn it off with N_ENCODENEW(.F.) when no longer needed. In addition, make sure that you have specified the appropriate encryption key with N_SETKEY before the operation.

ALTERNATIVE:
PACK or REINDEX without N_ENCODENEW(.T.). After the operation use N_CODELVL to determine if the file has become unencrypted and reencrypt if necessary using N_ENCODE.

>>EXAMPLE(S):
The following examples will PACK a my.dbf encrypted with the key "%$#@!"

=N_SETKEY("%$#@!")
USE "my.dbf"
=N_ENCODENEW(.T.)
PACK
=N_ENCODENEW(.F.)

ALTERNATIVE:

=N_SETKEY("%$#@!")
USE "my.dbf"
PACK
USE
IF N_CODELVL("my.dbf") == 1
* not encrypted anymore
=N_ENCODE("my.dbf" , "temp.dbf")
ERASE "my.dbf"
RENAME "temp.dbf" TO "my.dbf"
ENDIF
>>SEE ALSO:

>>COPYRIGHT 1997 Communication Horizons
All rights reserved worldwide. No distribution without specific consent of publisher.


Knowledgebase Top Home

 

© Copyright 2001 Communication Horizons LLC.
“NetLib” and “Encryptionizer” are Registered Trademarks of Communication Horizons.
US and international patents pending.
Updated 29 Dec 2001