feat: keystroke obfuscation#135
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces outbound keystroke-timing obfuscation for interactive (PTY) SSH sessions by quantizing write timing and sending SSH_MSG_PING “chaff” packets between real keystrokes, modeled after OpenSSH’s approach.
Changes:
- Add
obscureKeystrokeTimingIntervalMstoSshClientConfigand plumb it throughSshClient→SshConnection→SessionChannel. - Implement
KeystrokeObfuscatortiming logic and integrate it intoSessionChannel.write()with a background chaff-sending loop. - Add unit/integration tests covering obfuscator timing behavior and chaff emission/cadence, and update
sshlib/api.txt.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sshlib/src/main/kotlin/org/connectbot/sshlib/client/KeystrokeObfuscator.kt | Adds the timing/state machine for interval scheduling and chaff-window tracking. |
| sshlib/src/main/kotlin/org/connectbot/sshlib/client/SessionChannel.kt | Routes writes through obfuscation when PTY + ping support + interval enabled; launches chaff loop. |
| sshlib/src/main/kotlin/org/connectbot/sshlib/client/SshConnection.kt | Adds config parameter plumbing and introduces sendChaff() using SSH_MSG_PING. |
| sshlib/src/main/kotlin/org/connectbot/sshlib/SshClientConfig.kt | Adds public configuration knob and builder documentation for keystroke timing obfuscation. |
| sshlib/src/main/kotlin/org/connectbot/sshlib/SshClient.kt | Passes new config field into SshConnection. |
| sshlib/src/test/kotlin/org/connectbot/sshlib/client/KeystrokeObfuscatorTest.kt | Unit tests for timing behavior (activation, delay, interval advance, fuzz bounds). |
| sshlib/src/test/kotlin/org/connectbot/sshlib/client/KeystrokeObfuscationTest.kt | Integration-style tests validating when chaff is sent and encrypted-wire size/cadence expectations. |
| sshlib/api.txt | Updates public API surface to include the new config property and constructor parameter. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Modeled after OpenSSH keystroke obfuscation "send chaff" technique to assist in defeating keystroke timing attacks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Modeled after OpenSSH keystroke obfuscation "send chaff" technique to assist in defeating keystroke timing attacks.