Question Decryptor/Encryptor?

Zirak

New member
Joined
Oct 7, 2009
Messages
3
Programming Experience
Beginner
I've been working on a simple program that allows you to Put strings into the text box and encrypt it with a simple formula. (BC + ASCII Code)
But now I'm trying to make it so I can Convert a file that's encrypted (Using BC + ASCII) into just ASCII.

How would I accomplish this. I don't have any clue on where to get started, any help would be appreciated.
 
Last edited:
This is what I use. Not perfectly secure, but works great.

Public Function Decrypt(ByVal strText As String, ByVal strKey As String) As String
'This function will encrypt or decrypt a string based on a key. Not sure how it works,
'but it does it pretty good job at scrambling strings.
Try
Dim lTextPos As Long
Dim lKeyPos As Long
For lKeyPos = 1 To Len(strKey)
Mid(strKey, lKeyPos, 1) = Chr(Asc(Mid(strKey, lKeyPos, 1)) Xor 255)
Next lKeyPos
lKeyPos = 1
For lTextPos = 1 To Len(strText)
Mid(strText, lTextPos, 1) = Chr(Asc(Mid(strText, lTextPos, 1)) Xor Asc(Mid(strKey, lKeyPos, 1)))
lKeyPos = lKeyPos + 1
If lKeyPos > Len(strKey) Then lKeyPos = 1
Next lTextPos
Return strText
Catch ex As Exception
ProcessError("clsSecurity", "Decrypt", ex.Message)
Return ""
End Try
End Function
 
Back
Top