07-22-2003, 07:54 AM
Why complicate things, you can't break any decryption without the key no matter what. So an XOR cryption will do fine for most things. And it's small too.
Code:
defint a-z
function xorEncrypt$ ( src as string, ekey as string )
dim i as integer
dim dst as string
dim keyLen as integer
keyLen = len( ekey )
for i = 1 to len ( src )
dst = dst + chr$( asc(mid$( src, i, 1 )) xor _
asc(mid$( ekey, i mod keyLen + 1, 1 )) )
next i
xorEncrypt$ = dst
end function
defint a-z
function xorDecrypt$ ( src as string, ekey as string )
dim i as integer
dim dst as string
dim keyLen as integer
keyLen = len( ekey )
for i = 1 to len ( src )
dst = dst + chr$( asc(mid$( src, i, 1 )) xor _
asc(mid$( ekey, i mod keyLen + 1, 1 )) )
next i
xorDecrypt$ = dst
end function
oship me and i will give you lots of guurrls and beeea