Skip to content

split storage key and encryption key #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

rdaunce
Copy link

@rdaunce rdaunce commented Jun 15, 2021

The .NET port did not convert the storage of encrypted passwords correctly. It was using the encryption key as the dictionary key, storing the encrypted password and encrytion key in the same location. This makes the encrypted password decryptable if someone were to compromise the underlying data store. This commit creates a separate storage key for lookup purposes and does not store the encryption key. A separate token is created that includes the storage key and the encryption key that is only used to generate the URL. See pinterest/snappass#63 for additional conversation on the original source repo.

rdaunce and others added 5 commits June 15, 2021 13:32
The .NET port did not convert the storage of encrypted passwords correctly.  It was using the encryption key as the dictionary key, storing the encrypted password and encrytion key in the same location.  This makes the encrypted password decryptable if someone were to compromise the underlying data store.  This commit creates a separate storage key for lookup purposes and does not store the encryption key.  A separate token is created that includes the storage key and the encryption key that is only used to generate the URL.  See pinterest/snappass#63 for additional conversation on the original source repo.
The .NET port included the password on a hidden form on the initial page request.  A button to reveal the password only unhid the form.  This caused the initial page request to expire the password, even if it wasn't viewed.  The intention of the preview feature was to prevent bots that prefetch the URL from destroying the secret.  This commit removes the password from the preview page and adds a new page where the secret is revealed.  Now the secret is only destroyed if the secret is revealed.  Ported based on pinterest/snappass#100
This was not ported properly to encode the encryption key.  See pinterest/snappass#73
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant