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

ssh-cipher: make ChaCha20Poly1305 accept a 256-bit key #254

Merged
merged 1 commit into from
Jul 28, 2024

Conversation

tarcieri
Copy link
Member

In the OpenSSH protocol, ChaCha20Poly1305 uses two different keys: one for length encryption, and one for payloads.

It wasn't previously possible to use both keys (or at least quite obtuse) because ssh-cipher chopped up k_1 and k_2 and only allowed k_1 to be used.

This change hoists that into ssh-key for file encryption uses, giving access to the raw ChaCha20Poly1305 implementation and allowing use of either key.

In addition, a nonce is now mandatory, but use of the default all-zero nonce for file encryption purposes is now handled in ssh-key.

In the OpenSSH protocol, ChaCha20Poly1305 uses two different keys: one
for length encryption, and one for payloads.

It wasn't previously possible to use both keys (or at least quite
obtuse) because `ssh-cipher` chopped up `k_1` and `k_2` and only allowed
`k_1` to be used.

This change hoists that into `ssh-key` for file encryption uses, giving
access to the raw `ChaCha20Poly1305` implementation and allowing use of
either key.

In addition, a nonce is now mandatory, but use of the default all-zero
nonce for file encryption purposes is now handled in `ssh-key`.
@tarcieri tarcieri force-pushed the ssh-cipher/lower-level-chacha20poly1305-support branch from 5088a73 to 8b34eb2 Compare July 28, 2024 22:42
@tarcieri tarcieri merged commit 30e70e9 into master Jul 28, 2024
20 checks passed
@tarcieri tarcieri deleted the ssh-cipher/lower-level-chacha20poly1305-support branch July 28, 2024 22:47
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.

1 participant