kurt69
Well-known member
Hi, I'm trying to write a decryption program. Firstly I'll tell you how the encryption works; in the beginning of the file there is 123 useless bytes before the actual data. Now each encrypted character is created by adding the sum of the unencrypted character and the matching character in the key (which is a string). The character that matches depends on what the characters position is in the line.
EG: If it is the first character in that line then it is added to the first character of the key string, if it is the 2nd then it is added too the 2nd character of the key string. If the end of the key string is reached and the last character is used, then it goes back to the 1st character of the key string.
So please help me, So far this is the closest I can get to my goal; (I haven't tested this yet)
EG: If it is the first character in that line then it is added to the first character of the key string, if it is the 2nd then it is added too the 2nd character of the key string. If the end of the key string is reached and the last character is used, then it goes back to the 1st character of the key string.
So please help me, So far this is the closest I can get to my goal; (I haven't tested this yet)
VB.NET:
Public Sub crypt(ByVal strmR As StreamReader)
Dim i As Integer = 0
For i = 0 To 123
strmR.BaseStream.ReadByte()
Next
Dim buf() As Integer
Dim j As Integer = 0
Dim prev
While strmR.Peek <> -1
prev = strmR.BaseStream.Position
For i = 0 To strmR.ReadLine.Length
strmR.BaseStream.Position = prev
buf(i) = strmR.Read()
If j < key.Length Then
j += 1
Else
j = 0
j += 1
End If
buf(i) += j
prev = strmR.BaseStream.Position
strmR.ReadLine()
Next
End While
End Sub