|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.authentication.AuthenticationEventSender
org.openuat.authentication.DHOverTCPWithVerification
org.openuat.authentication.accelerometer.MotionAuthenticationProtocol1
public class MotionAuthenticationProtocol1
This is the first variant of the motion authentication protocol. It uses Diffie-Hellman key agreement with verification that the shared keys are equal on both hosts by sending the full time series segment through interlock, encrypted with the shared key. THen both hosts compute the coherence between the received time series segment and their own and continue when it exceeds a threshold.
| Field Summary | |
|---|---|
protected double |
lastCoherenceMean
This is only used to remember the coherence mean that has been computed last. |
static int |
TcpPort
The TCP port we use for this protocol. |
| Fields inherited from class org.openuat.authentication.DHOverTCPWithVerification |
|---|
useJSSE |
| Fields inherited from class org.openuat.authentication.AuthenticationEventSender |
|---|
eventsHandlers |
| Constructor Summary | |
|---|---|
MotionAuthenticationProtocol1(double coherenceThreshold,
int windowSize,
boolean useJSSE)
Initializes the object, only setting useJSSE at the moment. |
|
| Method Summary | |
|---|---|
void |
addSegment(double[] segment,
int startIndex)
The implementation of SegmentsSink.addSegment. |
double |
getCoherenceThreshold()
Returns the current value of the coherence threshold. |
boolean |
getContinuousChecking()
Returns the current value of continuousChecking. |
double |
getLastCoherenceMean()
Returns the last coherence mean value that has been computed locally. |
static void |
main(java.lang.String[] args)
|
protected void |
protocolFailedHook(java.net.InetAddress remote,
java.lang.Object optionalRemoteId,
java.lang.Exception e,
java.lang.String message)
Called by the base class when the whole authentication protocol failed. |
protected void |
protocolProgressHook(java.net.InetAddress remote,
java.lang.Object optionalRemoteId,
int cur,
int max,
java.lang.String message)
Called by the base class when the whole authentication protocol shows progress. |
protected void |
protocolSucceededHook(java.net.InetAddress remote,
java.lang.Object optionalRemoteId,
java.lang.String optionalParameterFromRemote,
byte[] sharedSessionKey,
java.net.Socket toRemote)
Called by the base class when the whole authentication protocol succeeded. |
protected void |
resetHook()
Called by the base class when the object is reset to idle state. |
void |
setCoherenceThreshold(double coherenceThreshold)
Sets the coherence threshold. |
void |
setContinuousChecking(boolean continuousChecking)
Enable or disable continuous checking. |
void |
startAuthentication(java.lang.String remoteHost)
This method only calls the base class startAuthentication method. |
protected void |
startVerification(byte[] sharedAuthenticationKey,
java.net.InetAddress remote,
java.lang.String param,
java.net.Socket socketToRemote)
Called by the base class when shared keys have been established and should be verified now. |
| Methods inherited from class org.openuat.authentication.DHOverTCPWithVerification |
|---|
isIdle, isVerifying, startAuthentication, startServer, stopServer, verificationFailure, verificationSuccess |
| Methods inherited from class org.openuat.authentication.AuthenticationEventSender |
|---|
addAuthenticationProgressHandler, raiseAuthenticationFailureEvent, raiseAuthenticationProgressEvent, raiseAuthenticationSuccessEvent, removeAuthenticationProgressHandler |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TcpPort
protected double lastCoherenceMean
| Constructor Detail |
|---|
public MotionAuthenticationProtocol1(double coherenceThreshold,
int windowSize,
boolean useJSSE)
coherenceThreshold - A good value is 0.65 for samplerate=512 or 0.82 for samplerate=128.windowSize - A good value is samplerate/2.useJSSE - If set to true, the JSSE API with the default JCE provider of the JVM will be used
for cryptographic operations. If set to false, an internal copy of the Bouncycastle
Lightweight API classes will be used.| Method Detail |
|---|
protected void resetHook()
resetHook in class DHOverTCPWithVerification
protected void protocolSucceededHook(java.net.InetAddress remote,
java.lang.Object optionalRemoteId,
java.lang.String optionalParameterFromRemote,
byte[] sharedSessionKey,
java.net.Socket toRemote)
protocolSucceededHook in class DHOverTCPWithVerificationremote - The remote host with which the key exchange succeeded.optionalRemoteId - An optional remote ID, exactly as it has been passed
to verificationSuccess. May be null.optionalParameterFromRemote - If the remote device reported an additional
parameter with its success message, it will
be put into this parameter. May be null.sharedSessionKey - The shared session key (which is different from the
shared authentication key used for verification) that
can now be used for subsequent secure communication.toRemote - If it has been requested that the socket to the remote host
should stay connected, it will be passed in this parameter.
May be null.
protected void protocolFailedHook(java.net.InetAddress remote,
java.lang.Object optionalRemoteId,
java.lang.Exception e,
java.lang.String message)
protocolFailedHook in class DHOverTCPWithVerificationremote - The remote host with which the key exchange succeeded.optionalRemoteId - An optional remote ID, exactly as it has been passed
to verificationSuccess or verificationFailure. May be null.e - If not null, the exception describing the failure.message - If not null, the message describing the failure.
protected void protocolProgressHook(java.net.InetAddress remote,
java.lang.Object optionalRemoteId,
int cur,
int max,
java.lang.String message)
protocolProgressHook in class DHOverTCPWithVerificationremote - The remote host with which the key exchange succeeded.optionalRemoteId - An optional remote ID, exactly as it has been passed
to verificationSuccess or verificationFailure. May be null.cur - @see AuthenticationProgressHandler#AuthenticationProgressmax - @see AuthenticationProgressHandler#AuthenticationProgressmessage - @see AuthenticationProgressHandler#AuthenticationProgress
protected void startVerification(byte[] sharedAuthenticationKey,
java.net.InetAddress remote,
java.lang.String param,
java.net.Socket socketToRemote)
startVerification in class DHOverTCPWithVerificationsharedAuthenticationKey - This key should be verified to be equal on
both sides.remote - The remote host with which the key exchange succeeded.param - Optional parameters sent by the remote host during the key agreement
phase.socketToRemote - This socket is still open and can be used to communicate
with the remote host for verifying the authentication
key. When it is used, care must be taken not to
consume any bytes from the remote end that are not expected
during verification, because the same channel will be
used for exchanging status information about the success
or failure of the whole authentication protocol.interlockRunner,
AsyncInterlockHelper
public void addSegment(double[] segment,
int startIndex)
addSegment in interface SegmentsSinklocalSegment,
localSegmentLock
public void startAuthentication(java.lang.String remoteHost)
throws java.net.UnknownHostException,
java.io.IOException
remoteHost - The remote host with which to authentication
java.net.UnknownHostException
java.io.IOExceptionpublic void setCoherenceThreshold(double coherenceThreshold)
coherenceThreshold - The threshold over which a coherence value will be taken
as valid (i.e. shaken within the same hand). Must be
between 0 and 1.coherenceThresholdpublic double getCoherenceThreshold()
coherenceThresholdpublic void setContinuousChecking(boolean continuousChecking)
continuousChecking - Only set to true after reading the description
of the member variable continuousChecking. Generally
leave to false (the default).continuousCheckingpublic boolean getContinuousChecking()
continuousCheckingpublic double getLastCoherenceMean()
public static void main(java.lang.String[] args)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||