Skip to content
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

Password is not being used for derivating encryption key #11

Closed
davidmigloz opened this issue Jul 11, 2018 · 9 comments
Closed

Password is not being used for derivating encryption key #11

davidmigloz opened this issue Jul 11, 2018 · 9 comments

Comments

@davidmigloz
Copy link
Contributor

The user provided password is supposed to be used to derivate the encryption key. However, it seems that currently is not being used.

How to reproduce:

  1. Instantiate Armadillo with password A.
  2. Save some data
  3. Instantiate Armadillo with password B (without deleting data).
  4. Try to retrieved data stored with password A.
    -> You are able to retrieve the plain data
davidmigloz added a commit to davidmigloz/armadillo that referenced this issue Jul 11, 2018
@davidmigloz davidmigloz changed the title Password is not being used for deriavating encryption key Password is not being used for derivating encryption key Jul 11, 2018
@davidmigloz
Copy link
Contributor Author

davidmigloz commented Jul 11, 2018

The stretched password was not being added to the input key material array.
image
I've made a pull request with the fix.

@davidmigloz
Copy link
Contributor Author

But the fix implies that if someone was using password is not going to be able to decrypt the data anymore :$. Can we migrate the data somehow?

@patrickfav
Copy link
Owner

Hi David thx for the PR.

That looks bad :( I will think about if migration is feasible, otherwise we will have to bump the major version and maybe provide a workaround.

patrickfav added a commit that referenced this issue Jul 11, 2018
Fix Password is not being used for derivating encryption key #11
@davidmigloz
Copy link
Contributor Author

Maybe for future migrations, we can start storing the protocol version in the same way the storage salt is stored. So then we can easily check when the protocol version has been bumped and apply the proper data migration. Because currently I have no idea how we can detect it. What do you think?

@patrickfav
Copy link
Owner

I fear the app developer would need to track the migration (e.g. the have a migration flag for all the key/value pairs with user PW, the first time the value is accessed read it with password = null, then write it with the correct pw)

I will release a new version today with a note on the issue and probable migration issues.

@patrickfav
Copy link
Owner

For today there is a 0.5.0 release. Will think about a solution regarding migration the next couple of days.

@davidmigloz
Copy link
Contributor Author

Perfect. Thanks Patrick.

@davidmigloz
Copy link
Contributor Author

We could use the changing password feature #13 to make the migration easier. It would be changing from empty password to the user password.

@patrickfav
Copy link
Owner

Good idea, this would make it more simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants