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 207555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:44:46+00:00 2026-05-11T17:44:46+00:00

I have an internal WPF client application that accesses a database. The application is

  • 0

I have an internal WPF client application that accesses a database.

The application is a central resource for a Support team and as such includes Remote Access/Login information for clients. At the moment this database is not available via a web interface etc, but one day is likely to.

The remote access information includes the username and passwords for the client’s networks so that our client’s software applications can be remotely supported by us. I need to store the usernames and passwords in the database and provide the support consultants access to them so that they can login to the client’s system and then provide support. Hope this is making sense.

So the dilemma is that I don’t want to store the usernames and passwords in cleartext on the database to ensure that if the DB was ever compromised, I am not then providing access to our client’s networks to whomever gets the database.

I have looked at two-way encryption of the passwords, but as they say, two-way is not much different to cleartext as if you can decrypt it, so can an attacker… eventually. The problem here is that I have setup a method to use a salt and a passcode that are stored in the application, I have used a salt that is stored in the db, but all have their weaknesses, ie if the app was reflected it exposes the salts etc.

How can I secure the usernames and passwords in my database, and yet still provide the ability for my support consultants to view the information in the application so they can use it to login?

This is obviously different to storing user’s passwords as these are one way because I don’t need to know what they are. But I do need to know what the client’s remote access passwords are as we need to enter them in at the time of remoting to them.

Anybody have some theories on what would be the best approach here?

update
The function I am trying to build is for our CRM application that will store the remote access details for the client. The CRM system provides call/issue tracking functionality and during the course of investigating the issue, the support consultant will need to remote in. They will then view the client’s remote access details and make the connection

  • 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-05-11T17:44:47+00:00Added an answer on May 11, 2026 at 5:44 pm

    A similar situation occurs at our company, where the database administrators wish to maintain a pool of credentials amongst themselves.

    I was originally going to post this idea, but erickson beat me to it. However, it may be worth while to post some pseudo code to elaborate, so I suppose my time answering the question isn’t completely wasted…

    Things you will need:

    • A database management system
    • An asymmetric cipher (example: RSA):
    • A symmetric cipher (example: AES)
    • A key derivation function (example: PBKDF2, thanks erickson!)
      • This requires a cryptographic hash function (example: SHA-512)

    First off, let’s set up the database schema. These tables will be demonstrated shortly.

    CREATE TABLE users (
      user_id               INTEGER,
      authentication_hash   BINARY,
      authentication_salt   BINARY,
      public_key            BINARY,
      encrypted_private_key BINARY,
      decryption_key_salt   BINARY,
      PRIMARY KEY(user_id)
    )
    
    CREATE TABLE secrets (
        secret_id INTEGER,
        -- WHATEVER COLUMNS YOU REQUIRE TO ACCURATELY MODEL YOUR PASSWORDS (CLIENT INFO, ETC)
        PRIMARY KEY(secret_id)
    )
    
    CREATE TABLE granted_secrets (
      secret_id      INTEGER,
      recipient_id   INTEGER,
      encrypted_data BINARY,
      PRIMARY KEY(secret_id, recipient_id),
      FOREIGN KEY(secret_id) REFERENCES secrets(secret_id)
      FOREIGN KEY(recipient_id) REFERENCES users(user_id)
    )
    

    Before a user can begin using this system, they must be registered.

    function register_user(user_id, user_password) {
        authentication_salt = generate_random_salt()
        authentication_hash = hash(authentication_salt, user_password);
    
        (public_key, private_key) = asymmetric_cipher_generate_random_key_pair();
    
        decryption_key_salt = generate_random_salt()
        decryption_key = derive_key(decryption_key_salt, user_password)
        encrypted_private_key = symmetric_cipher_encrypt(
            input => private_key,
            key   => decryption_key
        )
    
        // IMPORTANT: The decryption_key_hash is never stored
    
        execute("INSERT INTO users (user_id, authentication_hash, authentication_salt, public_key, encrypted_private_key, decryption_key_salt) VALUES (:user_id, :authentication_hash, :authentication_salt, :public_key, :encrypted_private_key, :decryption_key_salt)")
    }
    

    The user can sign in to the system.

    function authenticate_user(user_id, user_password)
        correct_authentication_hash = query("SELECT authentication_hash FROM users WHERE user_id = :user_id")
    
        authentication_salt = query("SELECT authentication_salt FROM users WHERE user_id = :user_id")
        given_authentication_hash = hash(authentication_salt, user_password)
    
        return correct_authentication_hash == given_authentication_hash
    

    A secret can then be granted to a recipient user.

    function grant_secret(secret_id, secret_data, recipient_id) {
        recipient_public_key = query("SELECT public_key FROM users WHERE user_id = :recipient_id")
    
        encrypted_secret_data = asymmetric_cipher_encrypt(
            input      => secret_data,
            public_key => recipient_public_key
        )
    
        execute("INSERT INTO granted_secrets (secret_id, recipient_id, encrypted_data) VALUES (:secret_id, :recipient_id, :encrypted_secret_data)")
    }
    

    Finally, a user that have been granted access to a secret (the recipient) can retrieve it.

    void retrieve_secret(secret_id, recipient_id, recipient_password)
        encrypted_recipient_private_key = query("SELECT encrypted_private_key FROM users WHERE user_id = :recipient_id")
    
        recipient_decryption_key_salt = query("SELECT decryption_key_salt FROM users WHERE user_id = :recipient_id")
        recipient_decryption_key = derive_key(recipient_decryption_key_salt, recipient_password)
        recipient_private_key = symmetric_cipher_decrypt(
            input => encrypted_recipient_private_key,
            key   => recipient_decryption_key
        )
    
        encrypted_secret_data = query("SELECT encrypted_data FROM granted_secrets WHERE secret_id = :secret_id AND recipient_id = :recipient_id")
    
        secret_data = asymmetric_cipher_decrypt(
            input       => encrypted_secret_data,
            private_key => recipient_private_key
        )
    
        return secret_data
    

    Hopefully this can help. It certainly helped me flesh out my ideas.

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

Sidebar

Ask A Question

Stats

  • Questions 123k
  • Answers 123k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Ok, now I understand what you want. Well, the thing… May 12, 2026 at 1:07 am
  • Editorial Team
    Editorial Team added an answer Real VNC server 4.4 includes support for Xrandr, which allows… May 12, 2026 at 1:07 am
  • Editorial Team
    Editorial Team added an answer You can add your own validation methods with addMethod function May 12, 2026 at 1:07 am

Related Questions

I have a C# (2008/.NET 3.5) class library assembly that supports WPF (based on
There are many questions about WPF vs Winfoms and the benefits of migrating to
I want to add a constant value onto an incoming bound integer. In fact
I work on a large C# application (approximately 450,000 lines of code), we constantly

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.