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

moves encryption/decryption logic into MasterKey #5636

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

hughy
Copy link
Contributor

@hughy hughy commented Nov 12, 2024

Summary

adds encrypt and decrypt methods to the MasterKey class to encapsulate the logic for encrypting and decrypting arbitrary blobs

updates wallet encryption to use MasterKey for account encryption and decryption

changes MasterKey interface to isolate key derivation to encrypt and decrypt methods, so that clients interact with the XChaCha20Poly1305 key only through the MasterKey interface

  • changes unlock to only set the masterKey property on MasterKey instead of returning the key
  • removes unused 'deriveKey' and 'deriveNewKey' methods

allows decrypting account data in migrations independent of the Account and EncryptedAccount models

Closes IFL-3141

Testing Plan

  • updates existing unit test
  • adds encryption/decryption unit test to masterKey.test.ts

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes

adds encrypt and decrypt methods to the MasterKey class to encapsulate the logic
for encrypting and decrypting arbitrary blobs

updates wallet encryption to use MasterKey for account encryption and decryption

changes MasterKey interface to isolate key derivation to encrypt and decrypt
methods, so that clients interact with the XChaCha20Poly1305 key only through the
MasterKey interface
- changes unlock to only set the masterKey property on MasterKey instead of
  returning the key
- removes unused 'deriveKey' and 'deriveNewKey' methods

allows decrypting account data in migrations independent of the Account and
EncryptedAccount models
@hughy hughy requested a review from a team as a code owner November 12, 2024 22:15
@hughy hughy merged commit cb31f8d into staging Nov 22, 2024
14 checks passed
@hughy hughy deleted the feat/hughy/master-key-encryption branch November 22, 2024 20:24
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.

2 participants