Link to home
Start Free TrialLog in
Avatar of omarmf
omarmf

asked on

incrept or hide some files using vb

Dear Experts

I want to incrept or hide some files using vb application then show or decrept them using a password

plese advice
Avatar of _lv_
_lv_
Flag of Lithuania image

Seems to me, that advice won't help you. You need a WHOLE SOLUTION ON THE TRAY.
This question needs to be broken into more questions !! That way you can solve the parts you get stuck on or actually need help with in chunks and then you can put it together in the end !
SOLUTION
Avatar of vinnyd79
vinnyd79

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of omarmf
omarmf

ASKER

I want simply the simplest way to make some files unreachable for others

the idea only
There is NO WAY to prevent a person sitting in front of the computer that has access to the keyboard and disk drive from getting access to any file on the drive. You can, however, encrypt a files CONTENTS to prevent them from reading it. Is that what you are looking for perhaps? You can also obscure the location, perhaps, but everybodys knows: security by obscurity is never works. Finally, if you have Admin rights you can put files under the Admin profile and no other users will have access to those files when they are logged in...but as I said earlier, they could always boot up on an NTFS floppy disk and access the entire drive anyway (if they had the diskette and if they knew how and if they knew what they were looking for...)
One more thing: it is possible to mark a sector on the hard drive as being bad, then use direct disk reads/writes to put file data there. Some viruses used to use that method to hide, since then there are no entries in the FAT or Directory. But, almost all antivirus software will notice those direct disk writes to a bad sector and will flag it as "virus-like activity".

That leads to the real question on everybody's mind: what are you actually trying to accomplish? Perhaps we could give you a good solution if you told us the background of the problem you are trying to solve.
Avatar of omarmf

ASKER

Ok

 the thing is simply i want to make an application the=at helps to make somefiles unaccesable, we should be able to access them via our application

i think the best whay is to put the file in a table fiel BLOB so the user hav to load and create a file from this field, so i think that know i came to a more exact quistion

can i make this with access or i should use SQL server ??
This example uses 6 Textboxes and a command button. Text1 is used to receive the scan. If Text1 has the focus you can scan the serial and it should appear in Text1.  Also you should make sure your scanner is programmed to send a carriage return after the scan.



' add reference to Microsoft Excel Object Library

' declarations area of form
Dim xl As New Excel.Application
Dim wb As Excel.Workbook, ws As Excel.Worksheet
Dim x As Integer
Dim CurrentFile As String


Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyReturn Then
    CurrentFile = ""
    Call CreateExcelFile("C:\results", Text1.Text)
End If
End Sub

Private Sub CreateExcelFile(DirLoc As String, BarCode As String)
    If Dir(DirLoc, vbDirectory) = "" Then MkDir (DirLoc)
    If Right$(DirLoc, 1) <> "\" Then DirLoc = DirLoc & "\"
   
    CurrentFile = DirLoc & BarCode & ".xls"
   
    If Dir(CurrentFile) <> "" Then
        DisplayValues
    Else
        Set wb = xl.Workbooks.Add
        wb.SaveAs (CurrentFile)
        wb.Close
        Set wb = Nothing
    End If
   
    Text2.SetFocus
End Sub

Private Sub Command1_Click()
CurrentFile = ""
Call CreateExcelFile("C:\results", Text1.Text)
SaveValues
End Sub

Private Sub SaveValues()
Set wb = xl.Workbooks.Open(CurrentFile)
Set ws = wb.Sheets("Sheet1")
ws.Cells(1, 1).Value = Text2.Text
ws.Cells(2, 1).Value = Text3.Text
ws.Cells(3, 1).Value = Text4.Text
ws.Cells(4, 1).Value = Text5.Text
ws.Cells(5, 1).Value = Text6.Text
wb.Save
wb.Close
Set wb = Nothing
xl.Quit
Set xl = Nothing

MsgBox "all done"

End Sub


Private Sub DisplayValues()
Set wb = xl.Workbooks.Open(CurrentFile)
Set ws = wb.Sheets("Sheet1")
Text2.Text = ws.Cells(1, 1).Value
Text3.Text = ws.Cells(2, 1).Value
Text4.Text = ws.Cells(3, 1).Value
Text5.Text = ws.Cells(4, 1).Value
Text6.Text = ws.Cells(5, 1).Value
wb.Close
Set wb = Nothing
xl.Quit
Set xl = Nothing
End Sub
Duhhh.  I had 2 windows open and posted to the wrong one. Disregard the above.
Wouldn't it be easier to store the file as an encrypted data file, then when the user runs your app and enteres the proper password, it will "unlock" that data file and create it normally? The problem is that once the file is unlocked, the user can then copy it outside of your program and do whatever they want with it.
Avatar of omarmf

ASKER

Ok so is there any reference or component to use, better then impleminting the alghorthm

thank you
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial