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

chore: uuhhhhhh crypto lol #805

Merged
merged 4 commits into from
Apr 17, 2023
Merged

chore: uuhhhhhh crypto lol #805

merged 4 commits into from
Apr 17, 2023

Conversation

conradludgate
Copy link
Collaborator

@conradludgate conradludgate commented Mar 23, 2023

I have tested to make sure that old hashed/encrypted blobs still work under the new libraries. All the tests pass but I want to be extra thorough so let's hold for now...

We originally intended to use https://github.com/RustCrypto/nacl-compat/tree/master/crypto_box for the secretbox replacement, but the have their own keygen on top (they use a public+private key pair to generate nonce and to generate a symmetric key. We already have the symmetric key so that abstraction on top does not work). The underlying impl is the one we are using here. nacl-compat has been audited, which would imply that xsalsa20poly1305 also has been audited successfully.

argon2 crate is maintained by the same RustCrypto group. This has no claim to be audited. I will review the code myself, but it has quite a lot of downloads on crates.io and no reported vulnerabilities in it's lifetime.

@vercel
Copy link

vercel bot commented Mar 23, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
atuin ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 16, 2023 6:11am

@ellie
Copy link
Member

ellie commented Mar 23, 2023

Is this compatible with secretbox?

@conradludgate
Copy link
Collaborator Author

conradludgate commented Mar 23, 2023

Is this compatible with secretbox?

I haven't found any incompatibilities yet. argon2id13 is obviously supposed to be the same algorithm.

For secretbox, according to the libsodium docs

Algorithm details:
Encryption: XSalsa20 stream cipher
Authentication: Poly1305 MAC

Which XSalsa20Poly1305 is an implementation of

@conradludgate
Copy link
Collaborator Author

Nice benefit: since macos and libsodium were not good friends, full builds are down from 3m 18s to 1m 47s :D

@ellie
Copy link
Member

ellie commented Mar 23, 2023

Ohhhh wow very nice 👏

I'll give this a test tomorrow. Maybe see if we can get some of the community to try it as well? I imagine if it decrypts our history fine then it'll work for everyone, but...

@conradludgate
Copy link
Collaborator Author

Did a full re-sync, it decrypts everything fine 😌

@@ -33,3 +33,4 @@ chronoutil = "0.2.3"
tower = "0.4"
tower-http = { version = "0.3", features = ["trace"] }
reqwest = { workspace = true }
argon2 = "0.5.0"
Copy link
Member

Choose a reason for hiding this comment

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

did you also test the server stuff?

@ellie
Copy link
Member

ellie commented Apr 17, 2023

Just deleted my history and re-synced on this branch, it all worked ✨

Copy link
Member

@ellie ellie left a comment

Choose a reason for hiding this comment

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

LGTM! what's the worst that could happen?

@ellie ellie merged commit c7d89c1 into main Apr 17, 2023
8 checks passed
@ellie ellie deleted the crypto-rust branch April 17, 2023 20:12
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.

None yet

2 participants