Esempio n. 1
0
        /// <summary>
        /// Login method for user salt
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        public User LoginHash(Account account)
        {
            var newUser = new User
            {
                SaltedPwHash = CustomCoder.ByteArrayTostring(HashPasswordWithSalt(Encoding.UTF8.GetBytes(account.Password), salt))
            };

            return(newUser);
        }
Esempio n. 2
0
        /// <summary>
        /// Register method with a new Salt
        /// </summary>
        /// <param name="account"></param>
        /// <returns></returns>
        public User RegisterHash(Account account)
        {
            var newUser = new User
            {
                Name         = account.Name,
                SaltedPwHash = CustomCoder.ByteArrayTostring(HashPasswordWithSalt(Encoding.UTF8.GetBytes(account.Password), salt)),
                Salt         = CustomCoder.ByteArrayTostring(salt)
            };

            return(newUser);
        }