Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8458461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:05:16+00:00 2026-06-10T13:05:16+00:00

I have my own password encryption dll that I am using to check the

  • 0

I have my own password encryption dll that I am using to check the user’s password when they login, this is referenced in my User entity.

Now I have created the ability for a user to register which is working fine, apart from the passwords are yet to be encrypted.

My question is quite simple, where should I put the encryption of the new user’s password? I’m not sure as I am aware that the user’s password shouldn’t be transmitted in plain text, therefore I don’t know where the best place to call the encryption function:

  • User Entity (where the encryption dll is already used for validation).
  • The User repository where the save user method is.
  • The User controller where the user creation views are controlled.
  • Somewhere else that I haven’t considered!

Thanks very much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T13:05:17+00:00Added an answer on June 10, 2026 at 1:05 pm

    First of all, for client – server communication, I would suggest you to use SSL for the sensitive information (like passwords) not to be transferred in plain text format.

    Afterwards, it’s the common practice not to save passwords anywhere (even with encryption, but the hashed values of them.

    You can put the hash function to the set method of password property. Here is an example:

    public class Member
    {
        private string _username;
    
        public string Username
        {
            get { return _username; }
            set { _username = value.ToLowerInvariant(); }
        }
    
        public string Passhash {get;set;}
    
        public void SetPassword(string password)
        {
            Passhash = Crypto.Hash(password);
        }
    
        public bool CheckPassword(string password)
        {
            return string.Equals(Passhash, Crypto.Hash(password));
        }
    }
    
    public static class Crypto
    {
        public static string Hash(string value)
        {
            return Convert.ToBase64String(
                System.Security.Cryptography.SHA256.Create()
                .ComputeHash(Encoding.UTF8.GetBytes(value)));
        }
    }
    

    Edit:

    As Craig Stuntz pointed out, the Hash code in this example is very simple. See the following post for a more secure way to hash your password: Hashing passwords with MD5 or sha-256 C#

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my own password/login rules that I want to implement such as: Password:
I am using Tortoise SVN, and I tend to have my own username/password stored
I have own project and i would like add for this class same as
I have my own routing rules in routes.php, defined for all the pages that
What PAM call do I have to make to reset a user's password? I
We have our own web server hosting our website that is open to the
I have a datasource set in my Jetty.xml file that looks like this: <New
I am using an Account Controller which doesnt have its own table but uses
I would like to have my own custom change_password page and I am already
I have own component which works in my testing winform app good but when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.