com.mindbright.terminal
public abstract class TerminalInputChaff extends java.lang.Object implements TerminalInputListener, java.lang.Runnable
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 and Description |
---|
TerminalInputChaff() |
Modifier and Type | Method and Description |
---|---|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
sendBytes, sendBytesDirect, signalWindowChanged
public void startChaff()
public void stopChaff()
protected boolean isChaffActive()
public void typedChar(char c)
typedChar
in interface TerminalInputListener
c
- typed characterpublic void typedChar(byte[] b)
typedChar
in interface TerminalInputListener
b
- byte array contained the encoded version of the characterpublic void signalTermTypeChanged(java.lang.String newTermType)
signalTermTypeChanged
in interface TerminalInputListener
newTermType
- new terminal type to emulatepublic void sendBreak()
sendBreak
in interface TerminalInputListener
public void run()
run
in interface java.lang.Runnable
public void dispenseChaff()
protected abstract void sendTypedChar(int c)
protected abstract void sendFakeChar()