Private Sub Command1_click()
Dim S As String
S = RndCrypt(Text1.Text, "pass")
Text2.Text = S
End Sub
Public Function RndCrypt(ByVal Str As String, ByVal Password As String) As String
Dim SK As Long, K As Long
Rnd -1
Randomize Len(Password)
For K = 1 To Len(Password)
SK = SK + (((K Mod 256) Xor Asc(Mid$(Password, K, 1))) Xor Fix(256 * Rnd))
Next K
Rnd -1
Randomize SK
For K = 1 To Len(Str)
Mid$(Str, K, 1) = Chr(Fix(256 * Rnd) Xor Asc(Mid$(Str, K, 1)))
Next K
RndCrypt = Str
End Function