This Will Allow You To Encrypt As Password Right Before Use Save It So You Can Prevent Anyone From
This Will Allow You To Encrypt As Password Right Before Use Save It So You Can Prevent Anyone From Just Looking At The File That WAs Saved And
Rate This Will Allow You To Encrypt As Password Right Before Use Save It So You Can Prevent Anyone From
(1(1 Vote))
'this function is the encryption
Public Function Encrypt(ByVal Plain As String)
Dim Letter As String
For i = 1 To Len(Plain)
Letter = Mid$(Plain, i, 1)
Mid$(Plain, i, 1) = Chr(Asc(Letter) + 99)'the 99 is the ascii value changed from password...you can change it to what ever you want as long as it's under 255
Next i
Encrypt = Plain
End Function
'this function is the decryption
Public Function Decrypt(ByVal Encrypted As String)
Dim Letter As String
For i = 1 To Len(Encrypted)
Letter = Mid$(Encrypted, i, 1)
Mid$(Encrypted, i, 1) = Chr(Asc(Letter) - 99)'the 99 is the ascii value changed from password...you can change it to what ever you want as long as it's under 255
Next i
Decrypt = Encrypted
End Function
Open "YourFile" For Input As #1
Input #1, password'loads the password. Example for YourFile...."c:\windows\myfile.txt
Close #1
password = Decrypt(password)'decrypts the password
password = Encrypt(password) 'encrypts password
Open "YourFile" For Output As #1'saves the password. Example for YourFile...."c:\windows\myfile.txt
Print #1, password
Close #1
password = Decrypt(password)'use this if you are going to still use password
This Will Allow You To Encrypt As Password Right Before Use Save It So You Can Prevent Anyone From Comments
No comments yet — be the first to post one!
Post a Comment