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( 密码)
其已被宣布为字符串... 您为什么想要获得字节!这里
message
的作用是什么?rand
和outarr
对message
做了什么?outar( 消息. Length) = 112 Xor Rand code> - 我无法理解