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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:19:58+00:00 2026-05-25T13:19:58+00:00

I want to encrypt a given data using the log-in user’s password on a

  • 0

I want to encrypt a given data using the log-in user’s password on a windows machine using WINAPI. I’ve been looking for a function that uses a token (or something like that) but I couldn’t find one.

Does anyone know how to do that?

Thanks! 🙂

  • 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-25T13:19:59+00:00Added an answer on May 25, 2026 at 1:19 pm

    I had written this answer earlier but then reconsidered, since I hadn’t heard of the DPAPI before. However, upon some further consideration, I’d like to offer the following opinion. The important preface here is that it all depends on your needs, though. Two conflicting possibilities come to mind:

    1. You want to offer your user complete protection and encryption that the user can trust only she will be able to decrypt, no matter the circumstances.

    2. You’re an enterprise IT manager and have all employees on a tight leash. You want them to encrypt business data as part of their workflow so that they cannot see each other’s data, but the admins can happily read everyone’s data.

    If you’re in situation (2), then stop reading now and go with DPAPI, which is well suited to that case. If you prefer scenario (1), then read my original answer below.


    That’s probably not a good idea. Here’s why:

    The actual password will not be stored on the system (unless you have Windows 3.11 or something like that). Instead, only a hash of the password will be stored, and at login time the password that the user enters is hashed and compared to the stored hash.

    So at best you could retrieve the stored hash from the system (if you have admin rights, say). However, if that’s the only datum you can go on, then any encryption key you make will be derived from that hash, rather than from the actual password. Thus anyone with access to the system could get to the stored hash, and from there derive the encryption key with relative ease.

    In short, don’t. Ask the user for a dedicated, fresh password for your data and use it for only that.

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

Sidebar

Related Questions

I want my application to encrypt a user password, and at one time password
I want a form where user can change password. I am able to encrypt
Is there any javascript function that can encrypt data: For example i want to
I want to encrypt some server data using .NET's RSACryptoServiceProvider and decrypt it when
i want to Encrypt and Decrypt data in J2ME using AES Algorithm with bouncy
I want to encrypt few files using python what is the best way I
I want the code of Rijndael algorithm to encrypt any given text to store
I'm storing a string in mysql with the ENCRYPT() function. I want to fetch
I want to user jquery ajax calls, for example; function addnewteacher(){ $.ajax({ type: POST,
I have given a task in which I need to encrypt an user's ID

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.