|
-
Aug 17th, 2000, 02:02 AM
#3
Thread Starter
New Member
Too Big
The reason I haven't posted it, is because it is a large
program. The Encryption Functions calls on other
information in the program. However here is the basics of my encryption.
[code]
global dKey as Double,sKey as Double,D(255) As Byte
function Encrypt(OriginalFile)
'Promt user to enter a Key: call Key(text1.text)
sfile=OriginalFile
Rnd (-dKey): Randomize dKey
xfile = sfile & ".stdenc"
Open sfile For Random As #1 Len = 1
lenfile = LOF(1)
Close
ReDim C(lenfile) As Byte, x(lenfile) As Byte
Open sfile For Binary As #1
Get #1, 1, C()
Close
y = 0
For i = 1 To lenfile
y = y + 1
y = y Mod 255 + 1
x(i) = C(i) Xor D(y)
Next i
Open xfile For Binary As #1
Put #1, 1, x()
Close
End Function
private Sub Key (x as String)
For i = 1 To (Len(x) - 1)
t = t + Asc(Mid(x, i, 1))
Next i
t = t - Asc(Mid(x, Len(x), 1))
t = t ^ 2 - t
Rnd (-t)
Randomize t
sKey = Int(Rnd * 2123234345) + 2000398
dKey = Int(sKey / 1000 + 603)
Rnd (-sKey)
Randomize sKey
For i = 1 To 255
g = Int(Rnd * 255) + 1
h = Int(Rnd * 255) + 1
D(i) = g Xor h
Next i
end sub
This is My encryption in a nutshell. In my program i have error checking and Key verification(i.e you cannot decrypt a file that is not encrypted, and the key you enter to decrypt must match the original key)
So what do you think??
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
|