Skip to content

Conversation

01zulfi
Copy link
Collaborator

@01zulfi 01zulfi commented Oct 8, 2025

Related #8526

Copy link
Contributor

@thecodrr thecodrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall.

Comment on lines 563 to 570
{
alg: item.alg,
iv: item.iv,
cipher: item.cipher,
format: "base64",
length: item.length,
salt: ""
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not pass the item as-is?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

salt is not present in SyncInboxItem

@01zulfi 01zulfi requested a review from thecodrr October 9, 2025 05:32
cipher: item.cipher,
format: "base64",
length: item.length,
salt: ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the salt from the key then.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inbox keys? They don't have a salt. Or, do you mean the salt from user's database encryption key?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No from the decryptedKey

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decryptedKey is just a string, I'm not sure how to derive salt from there

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are you decrypting without the salt? We need the salt.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

salt is not passed to the decryption functions at all, that's why I'm getting away with just passing an empty string here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, you modified KeyUtils.transform. I don't think that's a good idea. We will need to include the salt from the inbox-api-server so it can be used here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR to send salt streetwriters/notesnook-sync-server#57

Ah I see, you modified KeyUtils.transform. I don't think that's a good idea.

This is done to accommodate the absence of salt in the key, not sure how to handle this.

@01zulfi 01zulfi force-pushed the inbox/decryption-and-sync branch from 219c4bb to 53d7ccb Compare October 13, 2025 06:43
@01zulfi 01zulfi requested a review from thecodrr October 13, 2025 06:44
@thecodrr thecodrr merged commit 7f558cb into streetwriters:beta Oct 13, 2025
1 check passed
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