Decrypt the file

Posted on 2004-12-01
Last Modified: 2010-04-17
Dear Experts

I have one encrypted file. i need decrypt the file line by line using visual basic program.


open filename for input as #1,
do while not eof(1)
   line input #1,TextLine ( = decrypt line)
close #1

but original file no need to decrypt. i need open encrypted file and decrypt line by line

pls. pls. pls. help be

Best Regards,

M. Mohamed Rafeek
Question by:md_yasheen
    LVL 13

    Expert Comment

    What algorithm was used to encrypt the data?
    LVL 48

    Accepted Solution

    Private Declare Function EncryptFile Lib "ADVAPI32" Alias "EncryptFileA" (ByVal lpFileName As String) As Boolean
    Private Declare Function DecryptFile Lib "ADVAPI32" Alias "DecryptFileA" (ByVal lpFileName As String, ByVal dwReserved As Long) As Boolean
    Const mFile = "c:\test.txt"
    Private Sub Form_Load()
        'KPD-Team 2000
        Encrypt mFile
    End Sub
    Sub Encrypt(sFile As String)
        If EncryptFile(mFile) Then
            MsgBox "The file's succesfully encrypted. Log in as another user and try to access this file."
        End If
    End Sub
    Sub Decrypt(sFile As String)
        If DecryptFile(mFile, 0) = True Then
            MsgBox "The file's succesfully decrypted."
        End If
    End Sub

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This article is filled with multiple code samples and explanations for mathematical calculations. They are as follows: 1. General tips 2. Quadratic formula 3. Object collision 4. Projectile path General Tips       Here are some of my tips f…
    This is about my first experience with programming Arduino.
    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 seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    779 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

    15 Experts available now in Live!

    Get 1:1 Help Now