Public Function encrypt(ByVal message As Byte(), ByVal password As String) As Byte()
Dim passarr As Byte() = System.Text.Encoding.Default.GetBytes(password)
Randomize()
Dim rand As Integer = Int((255 - 0 + 1) * Rnd()) + 1
Dim outarr(message.Length) As Byte
Dim u As Integer
For i As Integer = 0 To message.Length - 1
outarr(i) += (message(i) Xor passarr(u)) Xor rand
If u = password.Length - 1 Then u = 0 Else u = u + 1
Next
outarr(message.Length) = 112 Xor rand
Return outarr
End Function
我想问的问题:
getbytes(password)
它已经声明为字符串...为什么要获取字节!这里的作用是
message
什么?正在
rand
做outarr
什么message
?outarr(message.Length) = 112 Xor rand
- 我无法理解这