Encryption key string that's used to hash the password stored in the usersecurity file's password field.

The value is hashed when a user is saved via the SaveUser(). Hashed passwords end in a postfix of ~~.


Default Value

String value that is used to encode passwords for hashing. The value is further hashed and salted before writing the hashed password into the table.


loSecurity = CREATEOBJECT("wwUserSecurity")
loSecurity.cPasswordEncryptionKey = "seekrit"

*** Create a new User

loUser = loSecurity.oUser
loUser.Username = "test2@west-wind.com"
loUser.Password = "test2"
loUser.FullName = "Test2 User"

lcOld = loSecurity.oUser.password

*** Saves user with encrypted password
llResult = loSecurity.SaveUser()

lcnew = loSecurity.oUser.password  && Encrypted with ~~

*** Try to authenticate against encrypted DB data
llResult = loSecurity.Authenticate("test2@west-wind.com","test2")
this.AssertTrue(llResult,"Authentication should work")


See also:

Class wwUserSecurity

© West Wind Technologies, 1996-2024 • Updated: 01/31/2017
Comment or report problem with topic