lbryio / lbryio/lbry-sdk

Questions about sha256 and salt used

Open
#3,737 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
493
PR merge metrics
No merged PRs in 30d

Description

I've got some questions when browsing the source code.

  1. The sha256 here is used to generate the key from secret. But sha256 itself is not a secure algorithm for key derivation. Some other algorithms like PBKDF2 will be better.

  2. Why the salt and IV are the same here, they are supposed to be different to provide security.

I think these two may lead to potential vulnerabilities.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting lbry/crypto/crypt.py at the sha256 usage near line 19 and the salt and IV handling near line 46. Compare the key-derivation and encryption parameters with the issue's security concerns; done means the vulnerability assessment is resolved and any required change is clearly defined and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cryptography, security
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.