Effective encryption of VFP database by file function

Source: Internet
Author: User

650) this.width=650; "src=" Http://183.61.143.148/group1/M00/02/54/tz2PlFQ_ZziyvEvLAAAlx7PZzpc216.jpg "style=" border:0px; "/>

every thing will have its own weak link, of course, VFP is no exception. In VFP, there is a very weak link is the database of poor confidentiality. Because. DBF files are open and can be browsed even with the simplest type command in DOS, so the small series encrypts the data in the following two ways:
1. When adding data to a free table, encrypt the data when the free table is updated, and then decrypt the data when it is read.
2, with VFP provided by the low-level file function to encrypt, the encrypted file cannot open, browse, use, and then execute the encryption program can restore the encrypted free table.
* * Encrypt database program (also decryption program) * *
set Talk off
Close All
Clea
@10,10 Say″ Please enter the name of the free table to encrypt (with extension): ″get file1 defa′′
Read
Handle=fopen (″&file1″,2)
if Handle<0
@14,10 Say″ cannot open file!″
=inkey (0)
Retu
endif
j=0
Do While . not.feof (handle)
Bb=fread (handle,1)
CC=CHR (mod (for ASC (BB) +128,256))
=fseek (handle,j)
=fwrite (HANDLE,CC)
? ASC (BB), ASC (CC)
j=j+1
Enddo
=fclose (handle)
Close All

Return


there's more . Database Tutorials knowledge can be landed on E mentor Network.


Effective encryption of VFP database by file function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.