I have found code for text file encrypt and decrypt , unfortunately decrypt (command2) dont bring back my text file .
Pl. help
Or any body having better but very simple solution for it, I don't want a very critical method for encryption just for file forwarding purpose that other user not able to read it.
Private Sub Command1_Click()
Dim ff As Integer
Dim i As Long, n As Long
Dim b As Byte, c As Byte
ff = FreeFile
Open App.Path & "\REFERENCE_DATA.dat" For Binary As #ff
n = LOF(ff)
For i = 1 To n
Get #ff, i, b
c = b Xor &hff
Put #ff, i, c
Next i
Close #ff
MsgBox "file encrypted"
End Sub
Private Sub Command2_Click()
Dim ff As Integer
Dim i As Long, n As Long
Dim b As Byte, c As Byte
ff = FreeFile
Open App.Path & "\REFERENCE_DATA.dat" For Binary As #ff
n = LOF(ff)
For i = 1 To n
Get #ff, i, b
c = b Xor &hff
Put #ff, i, c
Next i
Close #ff
MsgBox "file decrypted"
End Sub
Bookmarks