Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3439376
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:18:10+00:00 2026-05-18T08:18:10+00:00

For Extra Security, i would like to Encrypt/Decrypt a MS Access 2000 (*.mdb) Database

  • 0

For Extra Security, i would like to Encrypt/Decrypt a MS Access 2000 (*.mdb) Database File.

I am using Delphi 7 and I am looking for a free or opensource solution (possible just two functions that allow you to pass a file name and a key).

I would like to perform the decrypt before my app starts, and the encrypt when the app shuts down. Where are the best places to do this. OnCreate, OnDestroy events?

I assume i would first have to create a small utility which uses the encrypt portion of the solution to encrypt the database file first?

thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:18:10+00:00Added an answer on May 18, 2026 at 8:18 am

    I understand the reasons which you have to encrypt your old access database , because the security of access 2000 and 2003 is very weak. but my primary recommendation is which try to upgrade to Access 2007 or higher which uses the Microsoft Cryptographic API, and incorporates significant improvements in security.

    If you can’t upgrade, here i leave an option to encrypt your mdb file.

    1) to encrypt you data you can use the JwaWinCrypt unit which is part of the Jedi JWSCL library, you can download this library from here.

    check this sample function which uses 3DES algorithm to encrypt a file.

    uses
      Classes,
      JwaWinType,
      JwaWinCrypt,
      SysUtils;
    
    
    procedure CryptFile(Const InFileName, OutFileName, Password: AnsiString; Encrypt: Boolean);
    const
      BufferSize=1024*64;
    var
      StreamSource  : TFileStream;
      StreamDest    : TFileStream;
      CRYPTPROV     : HCRYPTPROV;
      CRYPTHASH     : HCRYPTHASH;
      CRYPTKEY      : HCRYPTKEY;
      Buffer        : LPBYTE;
      BytesIn       : DWORD;
      Final         : Boolean;
    begin
      CryptAcquireContext(CRYPTPROV, nil, nil, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT);
      try
          CryptCreateHash(CRYPTPROV, CALG_3DES_112, 0, 0, CRYPTHASH);
          try
            CryptHashData(CRYPTHASH, @Password[1], Length(Password), 0);
            CryptDeriveKey(CRYPTPROV, CALG_3DES, CRYPTHASH, 0, CRYPTKEY);
          finally
            CryptDestroyHash(CRYPTHASH);
          end;
    
          StreamSource := TFileStream.Create(InFileName, fmOpenRead or fmShareDenyWrite);
          StreamDest   := TFileStream.Create(OutFileName, fmCreate);
          try
            GetMem(Buffer, BufferSize);
            try
                repeat
                  BytesIn   := StreamSource.Read(Buffer^, BufferSize);
                  Final     := (StreamSource.Position >= StreamSource.Size);
                  if Encrypt then
                    CryptEncrypt(CRYPTKEY, 0, Final, 0, Buffer, BytesIn, BytesIn)
                  else
                  CryptDecrypt(CRYPTKEY, 0, Final, 0, Buffer, BytesIn);
                  StreamDest.Write(Buffer^, BytesIn);
                until Final;
            finally
             FreeMem(Buffer, BufferSize);
            end;
    
          finally
            StreamSource.Free;
            StreamDest.Free;
          end;
      finally
        CryptReleaseContext(CRYPTPROV, 0);
      end;
    end;
    

    and use in this way

    to encrypt a file

     CryptFile('C:\temp\in.zip', 'C:\temp\out.zip','fdkjldf3832kka83' ,True);
    

    to decrypt a file

     CryptFile('C:\temp\out.zip', 'C:\temp\in.zip','fdkjldf3832kka83' ,True);
    

    2) about the location of the code to encryot and decrypt the data, will depends of the design of you application.

    3) keep in mind that if your application crashes your data will be unprotected.

    4) maybe the best option is build a small application which decrypt your data and launch your main application and stay monitoring the status until the main application ends. and then encypt your data again.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wanting extra security for a particular point in my web app. So I
I'm trying to add extra validation to jdpl process-definition files using XSD. We have
From a Flash object, I would like to be able to detect the presence
I am developing a GWT application which im using Spring Security to handle the
I need to encrypt a plaintext message, using a 256-bit secret key. The ciphertext
I have created some extra functionality on my Linq-to-SQL classes to make things easier
How do I add extra data into an atom feed that does not map
I'm building an extra layer on top of Movable Type for integration with another
I want to create extra rules in FXCop. Custom Rules to help ensure specific
I don't understand where the extra bits are coming from in this article about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.