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

  • Home
  • SEARCH
  • 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 5980057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:44:51+00:00 2026-05-22T21:44:51+00:00

I am using the PKCS#5 standard to generate a key using a random and

  • 0

I am using the PKCS#5 standard to generate a key using a random and unique salt and the user`s password in input. Consider this key as the “encryption” key.

The “encryption” key is used to encrypt a random AES key. Each users have an AES key associated to their profile.

So, a user`s profile will contains this informations:

–> password hash for authentication purpose.

–> salt used in the PKCS#5 algo. (From the PKCS#5 V2.0 documentation, we know that this information needs no protection).

–> the encrypted AES key generated randomly and encrypted with the “encryption” key generated by the PKCS#5 algo with the salt and the user`s password

I was asking myself if it is dangerous to be in possession of the password`s hash, the salt and the encrypted AES key IN THE SAME TIME. I am 99.9% sure that this is not a problem, but can it facilitates the work of an attacker being in possession of all those details?

  • 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-22T21:44:52+00:00Added an answer on May 22, 2026 at 9:44 pm

    The password hash also needs to use a salt, otherwise dictionary attacks are possible and two users who happen to pick the same password will have the same hashed password stored in the DB.

    I would suggest this: Just use PKCS#5 twice; once to generate the hashed password (which you store in the clear), and once to generate the encryption key (which you do not).

    Make sure the salts are large, random, and independent, and then there will be no detectable relationship between the password hash and the encryption key. That is what the salt is for, after all.

    [update, to elaborate a bit]

    Pick two salts s1 and s2. Make sure each is at least 64 bits, random, and independent.

    Use the password + s1 as input to a PKCS#5 HMAC on the empty string. This is the “hashed password”.

    Use the password + s2 as input to a PKCS#5 encryption scheme to encrypt the actual data.

    Store the hashed password, s1, and s2 in the clear in the database. Done.

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

Sidebar

Related Questions

Using C#, I need a class called User that has a username, password, active
I need encrypt data using exactly the PKCS#1 V2.0 encryption method (defined in item
I'm trying to use httplib's HTTPSConnection for client validation, using a PKCS #12 certificate.
I wanted to extract the Signer Informations from PKCS#7 Signed Code Image using C/CPP.
I heard that PKCS#1 v2.0 encryption is usually called OAEP encryption. I'll need some
I'm looking to run some tests using the PKCS #11 interface and was wondering
I'm trying to find a way to read a privateKey created using OpenSSL PKCS#8
I have been issued a PKCS#12 certificate to be used for accessing a simple
I created a key and a csr on console, using the openssl executable. Then
I have an .pxf (AFAIK PKCS#12) certificate. How can I confirm a given password

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.