Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 435
  • Last Modified:

Decrypt the file

Dear Experts

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

Ex.

open filename for input as #1,
do while not eof(1)
   line input #1,TextLine ( = decrypt line)
loop
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
0
md_yasheen
Asked:
md_yasheen
1 Solution
 
gripeCommented:
What algorithm was used to encrypt the data?
0
 
Mikal613Commented:
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
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    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
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now