Re: Encryption Algorithms
I like to use Capicom, which Microsoft released. It encrypts differently each time, based on the time. It decrypts perfectly! You can google it.
I haven't encrypted files, but I'm pretty sure it would be possible. I have only encrypt text strings.
Re: Encryption Algorithms
I really only want to encrypt text strings (in turn, the text files). Can you provide any articles which have some algorithms or theory behind text encryption?
chem
Re: Encryption Algorithms
You mean other than Capicom? This is something that I have also used.
VB Code:
Dim ff As Integer
Public st As String
Private Sub Form_Load()
ff = FreeFile
Dim strBuff As String
ff = FreeFile
Open App.Path & "/site.txt" For Input As #ff
Do Until EOF(ff)
Line Input #ff, strBuff
Loop
Close #ff
Text1.Text = RC4ED(strBuff, "837ufhjjkddQR13%^&*&@#$&9ASFewFDAAW!%9367")
Call WriteFile
End Sub
Sub WriteFile()
ff = FreeFile
Open App.Path & "\site.txt" For Output As #ff
Print #ff, Text1.Text ' <-- Might need to use Write # to add quotes
Close #ff
End Sub
Function RC4ED(InString As String, password As String) As String
Dim S(0 To 255) As Integer
Dim K(0 To 255) As Integer
Dim I As Integer, j As Integer, tmp As Integer
Dim t As Integer
Dim outstring As String
For tmp = 0 To 255
S(tmp) = tmp
K(tmp) = Asc(Mid(password, 1 + (tmp Mod Len(password)), 1))
Next
For I = 0 To 255
j = (j + S(I) + K(I)) Mod 256
Swap S(I), S(j)
Next
I = 0
j = 0
outstring = ""
For tmp = 1 To Len(InString)
I = (I + 1) Mod 256
j = (j + S(I)) Mod 256
Swap S(I), S(j)
t = (S(I) + S(j)) Mod 256
outstring = outstring & Chr((mXor(S(t), Asc(Mid(InString, tmp, 1)))))
Next
RC4ED = outstring
End Function
Function mXor(I As Integer, j As Integer) As Integer
If I = j Then
mXor = j
Else
mXor = I Xor j
End If
End Function
Sub Swap(ByRef a As Integer, ByRef b As Integer)
Dim t As Integer
t = a
a = b
b = t
End Sub
Here's a link. Run the program twice. First time encrypts, second time decrypts.
http://vbforums.com/attachment.php?attachmentid=37573
Re: Encryption Algorithms
Thanks for that DG, can start to fiddle with some things now :D
chem
Re: Encryption Algorithms
I did not use it for a while, but you got encryption build into .Net
Check this out for a starter: RSA in VB.NET
Re: Encryption Algorithms
VS.net has a whole namespace full of encryption classes. Gives you full control of everything. You won't get any much more uncrackable than that.
Re: Encryption Algorithms
I kinda want to see how far I can go with my own. I also hoped to make a voice recognition decryption. The person says the password, and the text is decrypted. I might actually look alot deeper than I originally was for this..
Ta though :)
chem
Re: Encryption Algorithms
Quote:
Originally Posted by chemicalNova
I kinda want to see how far I can go with my own. I also hoped to make a voice recognition decryption. The person says the password, and the text is decrypted. I might actually look alot deeper than I originally was for this..
Ta though :)
chem
huh? whatever you are smoking, I want some too!