|
|||||||||
| 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.CKPOverUDP
org.openuat.authentication.accelerometer.ShakeWellBeforeUseProtocol2
public class ShakeWellBeforeUseProtocol2
This is the second variant of the motion authentication protocol. It broadcasts candidate keys over UDP and creates shared keys with the candidate key protocol.
| Field Summary | |
|---|---|
static int |
LocalCandidateHistorySize
Remember our own (locally generated) last 30 candidate key parts for detecting possible matches. |
static int |
MatchingCandidatesHistorySize
For each remote host, remember the last 20 matching key parts to have enough material for generating candidate keys. |
static int |
MaximumMatchingCandidatesAge
Keep the match history for each remote host for 5 minutes - should really be enough. |
static int |
MinimumNumberOfRoundsForAction
|
static java.lang.String |
MulticastGroup
|
protected int |
totalFFTTime
These are only for keeping statistics on time spent for FFT. |
static int |
UdpPort
The TCP port we use for this protocol. |
| Fields inherited from class org.openuat.authentication.CKPOverUDP |
|---|
instanceId, Maximum_Udp_Data_Size, totalCKPTime, totalCodingTime, totalMessageNum, totalMessageSize, useJSSE |
| Fields inherited from class org.openuat.authentication.AuthenticationEventSender |
|---|
eventsHandlers |
| Constructor Summary | |
|---|---|
ShakeWellBeforeUseProtocol2(int sampleRate,
int fftPoints,
int numQuantLevels,
int numCandidates,
int cutOffFrequency,
int windowOverlap,
float matchThreshold,
int minMatchingParts,
boolean useJSSE)
Initializes the object, only setting useJSSE at the moment. |
|
ShakeWellBeforeUseProtocol2(int sampleRate,
int fftPoints,
int numQuantLevels,
int numCandidates,
int cutOffFrequency,
int windowOverlap,
float matchThreshold,
int minMatchingParts,
boolean useJSSE,
int udpRecvPort,
int udpSendPort,
java.lang.String sendAddress,
java.lang.String instanceId)
Initializes the object, only setting useJSSE at the moment. |
|
| Method Summary | |
|---|---|
void |
addSample(double sample,
int numSample)
The implementation of SamplesSink.addSegment. |
static void |
main(java.lang.String[] args)
|
protected void |
protocolFailedHook(java.lang.String remote,
float matchingRoundsFraction,
java.lang.Exception e,
java.lang.String message)
This hook will be called when the whole authentication protocol has failed. |
protected void |
protocolProgressHook(java.lang.String remote,
int cur,
int max,
java.lang.String message)
This hook will be called when the whole authentication protocol has made some progress. |
protected void |
protocolSucceededHook(java.lang.String remote,
byte[] sharedSessionKey,
float matchingRoundsFraction)
This hook will be called when the final verdict is that the whole authentication protocol succeeded, i.e. both hosts signalled success on key verification. |
void |
segmentEnd(int numSample)
Should be called when it is detected that an active segment end, i.e. when it is detected that the source has become quiescent by some definition. |
void |
segmentStart(int numSample)
Should be called when it is detected that an active segment starts, i.e. when it is detected that the source has become active by some definition. |
| Methods inherited from class org.openuat.authentication.CKPOverUDP |
|---|
addCandidates, dispose |
| Methods inherited from class org.openuat.authentication.AuthenticationEventSender |
|---|
addAuthenticationProgressHandler, raiseAuthenticationFailureEvent, raiseAuthenticationProgressEvent, raiseAuthenticationStartedEvent, raiseAuthenticationSuccessEvent, removeAuthenticationProgressHandler, setAuthenticationProgressHandlers |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int UdpPort
public static final java.lang.String MulticastGroup
public static final int MinimumNumberOfRoundsForAction
public static final int LocalCandidateHistorySize
public static final int MatchingCandidatesHistorySize
public static final int MaximumMatchingCandidatesAge
protected int totalFFTTime
| Constructor Detail |
|---|
public ShakeWellBeforeUseProtocol2(int sampleRate,
int fftPoints,
int numQuantLevels,
int numCandidates,
int cutOffFrequency,
int windowOverlap,
float matchThreshold,
int minMatchingParts,
boolean useJSSE)
throws java.io.IOException
minMatchingParts - 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.
java.io.IOException
public ShakeWellBeforeUseProtocol2(int sampleRate,
int fftPoints,
int numQuantLevels,
int numCandidates,
int cutOffFrequency,
int windowOverlap,
float matchThreshold,
int minMatchingParts,
boolean useJSSE,
int udpRecvPort,
int udpSendPort,
java.lang.String sendAddress,
java.lang.String instanceId)
throws java.io.IOException
sampleRate - A good value is @see ShakeWellBeforeUseParameters.sampleratefftPoints - A good value is @see ShakeWellBeforeUseParameters.fftMatchesWindowSizenumQuantLevels - A good value is @see ShakeWellBeforeUseParameters.fftMatchesQuantizationLevelsnumCandidates - A good value is @see ShakeWellBeforeUseParameters.fftMatchesCandidatesPerRoundcutOffFrequency - A good value is @see ShakeWellBeforeUseParameters.fftMatchesCutOffFrequenecywindowOverlap - A good value is @see ShakeWellBeforeUseParameters.fftMatchesWindowOverlapmatchThreshold - A good value is @see ShakeWellBeforeUseParameters.fftMatchesThresholdminMatchingParts - 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.udpRecvPort - The UDP port number to listen for packets at.udpSendPort - The UDP port to send packets to.sendAddress - The (multicast or unicast) IP address to send UDP packets to.
java.io.IOException - // TODO: implement handling of minMatchingParts| Method Detail |
|---|
public void addSample(double sample,
int numSample)
addSample in interface SamplesSinksample - The new sample value to add.numSample - The index of this sample. All samples are required
to be equally spaced.public void segmentStart(int numSample)
SamplesSink
segmentStart in interface SamplesSinknumSample - The index at which the active segment starts.public void segmentEnd(int numSample)
SamplesSink
segmentEnd in interface SamplesSinknumSample - The index at which the active segment ends.
protected void protocolSucceededHook(java.lang.String remote,
byte[] sharedSessionKey,
float matchingRoundsFraction)
CKPOverUDP
protocolSucceededHook in class CKPOverUDPremote - The remote host address with which the key exchange succeeded.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.matchingRoundsFraction - The fraction of rounds where a match could be
found.
protected void protocolFailedHook(java.lang.String remote,
float matchingRoundsFraction,
java.lang.Exception e,
java.lang.String message)
CKPOverUDP
protocolFailedHook in class CKPOverUDPremote - The remote host address with which the key exchange failed.matchingRoundsFraction - The fraction of rounds where a match could be
found. Will be set to 0 if unknown.e - If not null, the exception describing the failure.message - If not null, the message describing the failure.
protected void protocolProgressHook(java.lang.String remote,
int cur,
int max,
java.lang.String message)
CKPOverUDP
protocolProgressHook in class CKPOverUDPremote - The remote host address with which the key exchange progressed.cur - @see AuthenticationProgressHandler#AuthenticationProgressmax - @see AuthenticationProgressHandler#AuthenticationProgressmessage - @see AuthenticationProgressHandler#AuthenticationProgress
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 | ||||||||