Hello all,

I got this code from the forums here, but am not sure where I should place it.

I want so that when a user enters his password it will be like this **** or something.

vb Code:
  1. Public Function RndCrypt(ByVal Str As String, ByVal Password As String) As String
  2.     '
  3.     '  Made by Michael Ciurescu (CVMichael from vbforums.com)
  4.     '  Original thread: [url]http://www.vbforums.com/showthread.php?t=231798[/url]
  5.     '
  6.     Dim SK As Long, K As Long
  7.    
  8.     ' init randomizer for password
  9.     Rnd -1
  10.     Randomize Len(Password)
  11.     ' (((K Mod 256) Xor Asc(Mid$(Password, K, 1))) Xor Fix(256 * Rnd)) -> makes sure that a
  12.     ' password like "pass12" does NOT give the same result as the password "sspa12" or "12pass"
  13.     ' or "1pass2" etc. (or any combination of the same letters)
  14.    
  15.     For K = 1 To Len(Password)
  16.         SK = SK + (((K Mod 256) Xor Asc(Mid$(Password, K, 1))) Xor Fix(256 * Rnd))
  17.     Next K
  18.    
  19.     ' init randomizer for encryption/decryption
  20.     Rnd -1
  21.     Randomize SK
  22.    
  23.     ' encrypt/decrypt every character using the randomizer
  24.     For K = 1 To Len(Str)
  25.         Mid$(Str, K, 1) = Chr(Fix(256 * Rnd) Xor Asc(Mid$(Str, K, 1)))
  26.     Next K
  27.    
  28.     RndCrypt = Str
  29. End Function