Secure Access Encryption method

Source: Internet
Author: User
Tags exit access database microsoft access database

Microsoft Access database, is one of our common desktop data, most of the small and medium-sized Enterprise database management System can adopt it, but its security has always been a burden, imagine, a financial management system, users directly open the database to change data, what will the consequences? Some systems may simply change the extension or add a password to an Access database, and it is well known that the methods and tools for breaking access passwords are many online! So this kind of encryption as a burden, the following describes a simple way to achieve access data encryption, for everyone's reference.

Open the MDB file with UltraEdit to see the contents of the first 16 bytes of the file:

4 A 65 74 (a) of 6E

Now just change a few, and then open with access to find different recognized file format errors, because the information saved before access is the definition of some MDB files and passwords, if you change the content, it is difficult for others to see the format of the database, can not open it, This does not make changes to the contents of the database and does not break the original data.

The following is to use Delphi to make a simple encryption solution program:

The cryptographic solution functions used are as follows:

Const
titlestr:array[0..15] of byte=
($00,$01,$00,$00,$53,$74,$61,$6e,$64,$61,$72,$64,$20,$4a,$65 , $74);//The first 16 bytes of the corresponding MDB file
titlestr2:array[0..15] of byte=
($48,$4a,$00,$58,$55,$43,$48,$41,$4e,$47,$59,$4f,$ 55,$00,$20,$20);//Change the first 16 bytes of the MDB file, write it yourself, for example, write your company's short name or the self-named
Produce Encrypmdb (filename:string);   Replaces the first 16 bytes of the MDB with TITLESTR2 content in order to implement the encryption effect
Var f:tfilestream
begin
If not fileexists (filename) then exit;
F:=tfilestream.create (Filename,fmopenwrite);    
Try
F.seek ($00,sofrombeginning);
F.write (titlestr2,16);  
finally
F.free;
End
End;
Produce Uncrypmdb (filename:string);//restore MDB first 16 bytes
Var f:tfilestream;
Begin
If not fileexists (filename) Then exit;
F:=tfilestream.create (Filename,fmopenwrite);    
Try
F.seek ($00,sofrombeginning);
F.write (titlestr,16);  
finally
F.free;
End
End;

We know that a locked file (. ldb file) appears when you open an Access database, because we also want to use the database ourselves, so we must restore the database when we use it.

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.