|
-
Jun 10th, 2000, 10:28 AM
#1
Thread Starter
Member
Can anyone help me create a file encryption/decryption prog.
I've made a registry prog. but now i need a way to encrypt and decrypt the file containing the password!! HELP
P.S. I'm pretty rusty in this area so make it easy to understand!~
-
Jun 10th, 2000, 11:15 AM
#2
Hyperactive Member
Searching this very site turned up a lot of results. But this thread seems helpful:
http://forums.vb-world.net/showthrea...threadid=17689
"People who think they know everything are a great annoyance to those of us who do."
-
Jun 10th, 2000, 03:47 PM
#3
transcendental analytic
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 10th, 2000, 09:16 PM
#4
_______
this works...
'Encrypt/Unencrypt a file
'
Option Explicit
'
Private Function EncryptFile(sFile As String, iKey As Integer)
Dim iFake#
Dim x As String * 1
Dim lP As Long, z
Dim intNum#
intNum = FreeFile
iFake = Rnd(-1)
Randomize (iKey)
lP = 1
Open sFile For Binary As intNum
While lP <= LOF(intNum)
Get #intNum, lP, x
z = Asc(x) + Int(Rnd * 256)
If z > 255 Then z = z - 256
x = Chr(z)
Put #intNum, lP, x
lP = lP + 1
Wend
Close #intNum
MsgBox "Your file has been encrypted."
End Function
Private Function DecryptFile(sFile As String, iKey As Integer)
Dim iFake As Integer
Dim x As String * 1
Dim lP As Long, z
Dim intNum#
intNum = FreeFile
iFake = Rnd(-1)
Randomize (iKey)
lP = 1
Open sFile For Binary As #intNum
While lP <= LOF(intNum)
Get #intNum, lP, x
z = Asc(x) - Int(Rnd * 256)
If z < 0 Then z = z + 256
x = Chr(z)
Put #intNum, lP, x
lP = lP + 1
Wend
Close #intNum
MsgBox "Your file has been unencrypted."
End Function
' <<<< Form Event Code >>>>
Private Sub Command1_Click()
Call EncryptFile("a:\book1.xls", 44)
End Sub
Private Sub Command2_Click()
Call DecryptFile("a:\book1.xls", 44)
End Sub
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Jun 10th, 2000, 09:39 PM
#5
You can also use the Xor operator with encryption keys.
Code:
MyCode = 50
MyVal = 65 Xor MyCode
Then reserve the process to decrypt it.
Code:
MyCode = 50
MyVal = 115 Xor MyCode
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|