Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mindbright.terminal
Class TerminalInputChaff

    java.lang.Object
      com.mindbright.terminal.TerminalInputChaff

All Implemented Interfaces:
  java.lang.Runnable, TerminalInputListener

Direct Known Subclasses:
  SSH2TerminalAdapterImpl, TelnetTerminalAdapter

public abstract class TerminalInputChaff
extends java.lang.Object
implements TerminalInputListener, java.lang.Runnable

Handles the sending of chaff to disguise the timing of key presses. Scientific research has shown that it may be possible to use keyboard timings to greatly reduce the work needed to perform a brute force password guessing attack. That is one can see the timing between the different keys as the user types them then this gives information about the password. To combat this MindTerm includes a technique called chaffing. When chaffic the client send a steady stream of data with fixed intervals, if there is no typed character to send a fake character is send instead. This kind of assumes an encrypted session since otherwise an attacker who can see timings coudl also see the password.

Chaffing means extra traffic so it should only be enabled when eeded. Fortunately it is often not needed since normally the terminal buffers the typed characters and sends them line-by line. The big exception is when sending passwords when the terminal is in non-echo mode.

Mote that this is not an issue for the initial password exchange in the SSH protocol but only applies when one sends passwords over a terminal session running over the encrypted link.

Constructor Summary
`TerminalInputChaff()`

Method Summary
`void` | `dispenseChaff()` Kick chaff thread
`protected boolean` | `isChaffActive()` Tell if chaffing is active or not
`void` | `run()` The thread which actually sends the chaff or real data.
`void` | `sendBreak()` Classes derived from this class that are capable of sending a break signal can implement this.
`protected abstract void` | `sendFakeChar()` Send a fake character to the server.
`protected abstract void` | `sendTypedChar(int c)` Send a real typed character to the server.
`void` | `signalTermTypeChanged(java.lang.String newTermType)` This callback is only interesting for local input listeners such as LineReaderTerminal
`void` | `startChaff()` Start sending chaff
`void` | `stopChaff()` Stop sending chaff
`void` | `typedChar(byte[] b)` Receive a character typed by the user, the whole point of chaffing is to disguise the timing of calls to this function.
`void` | `typedChar(char c)` Receive a character typed by the user, the whole point of chaffing is to disguise the timing of calls to this function.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.mindbright.terminal.TerminalInputListener
`sendBytes, signalWindowChanged`

Constructor Detail

### TerminalInputChaff

    public TerminalInputChaff()

Method Detail

### startChaff

    public void startChaff()

  Start sending chaff

### stopChaff

    public void stopChaff()

  Stop sending chaff

### isChaffActive

    protected boolean isChaffActive()

  Tell if chaffing is active or not

  Returns:
    true if chaff is being sent

### typedChar

    public void typedChar(char c)

  Receive a character typed by the user, the whole point of chaffing is to disguise the timing of calls to this function.

  Specified by:
    `typedChar` in interface `TerminalInputListener`
  Parameters:
    `c` - typed character

### typedChar

    public void typedChar(byte[] b)

  Receive a character typed by the user, the whole point of chaffing is to disguise the timing of calls to this function.

  Specified by:
    `typedChar` in interface `TerminalInputListener`
  Parameters:
    `b` - byte array contained the encoded version of the character

### signalTermTypeChanged

    public void signalTermTypeChanged(java.lang.String newTermType)

  This callback is only interesting for local input listeners such as LineReaderTerminal

  Specified by:
    `signalTermTypeChanged` in interface `TerminalInputListener`
  Parameters:
    `newTermType` - new terminal type to emulate

### sendBreak

    public void sendBreak()

  Classes derived from this class that are capable of sending a break signal can implement this.

  Specified by:
    `sendBreak` in interface `TerminalInputListener`

### run

    public void run()

  The thread which actually sends the chaff or real data.

  Specified by:
    `run` in interface `java.lang.Runnable`

### dispenseChaff

    public void dispenseChaff()

  Kick chaff thread

### sendTypedChar

    protected abstract void sendTypedChar(int c)

  Send a real typed character to the server.

### sendFakeChar

    protected abstract void sendFakeChar()

  Send a fake character to the server.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD