Public Function EncryptData(Input As String, Key As String) As String Return Convert.ToBase64String(EncryptData(System.Text.Encoding.UTF8.GetBytes(Input), System.Text.Encoding.UTF8.GetBytes(Key))) End Function Public Function EncryptData(Input As Byte(), Key As Byte()) As Byte() Dim Rnd As New Random() Dim Salt As Integer = Rnd.[Next](1, 50) Dim FinVal As Byte() = New Byte(Input.Length) {} FinVal(Input.Length) = CByte(Salt) Dim kc As Short = 0 For index As Integer = 0 To Input.Length - 1 If kc >= Key.Length Then kc = 0 End If FinVal(index) = Convert.ToByte(Input(index) + (Input.Length Mod Key.Length) + (Key(kc)) - Salt) kc += 1 Next Return FinVal End Function