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

Decryption does not yet work #1

Closed
xeals opened this issue Apr 2, 2018 · 2 comments
Closed

Decryption does not yet work #1

xeals opened this issue Apr 2, 2018 · 2 comments

Comments

@xeals
Copy link
Owner

xeals commented Apr 2, 2018

The decryption process currently gets hung on up a non-matching MAC between what the backup has and what we're expecting.

My major frustration and confusion at the moment is that the Java implementation allows for a 10-byte MAC, but the Rust crypto library produces 32-byte MACs following the same steps; obviously there's not going to be a time when these are equivalent. I'm not sure if it's a fundamental difference in how the Rust and Java libraries work.

I can process what I've written for the decryption process, but something along the line isn't exactly as it should be compared to the Java implementation. I'm diving into source for both languages to see where they differ. If anyone can point me to an open implementation of the javax.crypto library, I'd be grateful (as my version of OpenJDK doesn't have it).

@xeals
Copy link
Owner Author

xeals commented Apr 6, 2018

Update: I've traced down the only issue to be the difference in how the Java and Rust libraries implement their CTR AES decryption. Regardless of key size I'm not getting a decryptable result, so something's up with one of them.

@xeals
Copy link
Owner Author

xeals commented Apr 7, 2018

Good news: I rewrote the thing in Go and their AES implementation seems to work.

Bad news: I've found a neat little situation with memory usage when decrypting attachments.

I'll scope out what the new issues are and set up some trackers for people. However, I am making progress.

@xeals xeals closed this as completed Apr 7, 2018
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

No branches or pull requests

1 participant