create c++ application with openssl lib (aes) to lock/unlock a "txt file"

Posted on 2004-11-22
Last Modified: 2008-02-01
hi, is there any example on this available?  I interested in locking up a "txt" file using aes.  so each time the application is executed, user will be prompted for password . This pasword will be used to unlock the txt file.
Question by:second_comet
    1 Comment
    LVL 2

    Accepted Solution

    what's the platform ??

    e.g., if in windows , the following is a basic framewok of how the code would look like

    (1) program starts, uses the api CreateFile to open the text file in READ mode, with the share setting to exclusive (so no one else can access it)
    (2) prompts user for password
    (3) if password is correct, then call CloseHandle to release the file lock, so that user can access it
    (4) wait till user tells prog. to re-lock the file, at that point, go back to step(1)

    u can place the program in the startup folder, so that the file gets locked at startup.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now