Markopy
Utilizing Markov Models for brute forcing attacks
|
A node class that for the vertices of model. Connected with eachother using Edge. More...
#include <node.h>
Public Member Functions | |
Node () | |
Default constructor. Creates an empty Node. More... | |
Node (storageType _value) | |
Constructor. Creates a Node with no edges and with given NodeValue. More... | |
Edge< storageType > * | Link (Node< storageType > *) |
Link this node with another, with this node as its source. More... | |
Edge< storageType > * | Link (Edge< storageType > *) |
Link this node with another, with this node as its source. More... | |
Node< storageType > * | RandomNext (Markov::Random::RandomEngine *randomEngine) |
Chose a random node from the list of edges, with regards to its EdgeWeight, and TraverseNode to that. More... | |
bool | UpdateEdges (Edge< storageType > *) |
Insert a new edge to the this.edges. More... | |
Edge< storageType > * | FindEdge (storageType repr) |
Find an edge with its character representation. More... | |
Edge< storageType > * | FindEdge (Node< storageType > *target) |
Find an edge with its pointer. Avoid unless neccessary because comptutational cost of find by character is cheaper (because of std::map) More... | |
unsigned char | NodeValue () |
Return character representation of this node. More... | |
void | UpdateTotalVerticeWeight (long int offset) |
Change total weights with offset. More... | |
std::map< storageType, Edge< storageType > * > * | Edges () |
return edges More... | |
long int | TotalEdgeWeights () |
return total edge weights More... | |
Public Attributes | |
std::vector< Edge< storageType > * > | edgesV |
Private Attributes | |
storageType | _value |
Character representation of this node. 0 for starter, 0xff for terminator. More... | |
long int | total_edge_weights |
Total weights of the vertices, required by RandomNext. More... | |
std::map< storageType, Edge< storageType > * > | edges |
A map of all edges connected to this node, where this node is at the LeftNode. Map is indexed by unsigned char, which is the character representation of the node. More... | |
A node class that for the vertices of model. Connected with eachother using Edge.
This class will later be templated to accept other data types than char*.
Markov::Node< storageType >::Node |
Default constructor. Creates an empty Node.
Definition at line 209 of file node.h.
Markov::Node< storageType >::Node | ( | storageType | _value | ) |
|
inline |
return edges
Definition at line 272 of file node.h.
Referenced by Markov::API::MarkovPasswords::Buff().
Edge<storageType>* Markov::Node< storageType >::FindEdge | ( | Node< storageType > * | target | ) |
Find an edge with its pointer. Avoid unless neccessary because comptutational cost of find by character is cheaper (because of std::map)
target | - target node. |
Markov::Edge< storageType > * Markov::Node< storageType >::FindEdge | ( | storageType | repr | ) |
Find an edge with its character representation.
repr | - character NodeValue of the target node. |
Example Use: Construct and update edges
Markov::Edge< storageType > * Markov::Node< storageType >::Link | ( | Markov::Edge< storageType > * | v | ) |
Link this node with another, with this node as its source.
DOES NOT create a new Edge.
Example Use: Construct and link nodes
Definition at line 227 of file node.h.
Markov::Edge< storageType > * Markov::Node< storageType >::Link | ( | Markov::Node< storageType > * | n | ) |
Link this node with another, with this node as its source.
Creates a new Edge.
target | - Target node which will be the RightNode() of new edge. |
Example Use: Construct nodes
Definition at line 220 of file node.h.
|
inline |
Return character representation of this node.
Definition at line 215 of file node.h.
References Markov::Node< storageType >::_value.
Referenced by Markov::API::ModelMatrix::ConstructMatrix().
Markov::Node< storageType > * Markov::Node< storageType >::RandomNext | ( | Markov::Random::RandomEngine * | randomEngine | ) |
Chose a random node from the list of edges, with regards to its EdgeWeight, and TraverseNode to that.
This operation is done by generating a random number in range of 0-this.total_edge_weights, and then iterating over the list of edges. At each step, EdgeWeight of the edge is subtracted from the random number, and once it is 0, next node is selected.
Example Use: Use randomNext to do a random walk on the model
Definition at line 234 of file node.h.
References Markov::Random::RandomEngine::random().
|
inline |
return total edge weights
Definition at line 277 of file node.h.
Referenced by Markov::API::ModelMatrix::ConstructMatrix().
bool Markov::Node< storageType >::UpdateEdges | ( | Markov::Edge< storageType > * | v | ) |
Insert a new edge to the this.edges.
edge | - New edge that will be inserted. |
Example Use: Construct and update edges
Definition at line 252 of file node.h.
void Markov::Node< storageType >::UpdateTotalVerticeWeight | ( | long int | offset | ) |
Change total weights with offset.
offset | to adjust the vertice weight with |
|
private |
Character representation of this node. 0 for starter, 0xff for terminator.
Definition at line 179 of file node.h.
Referenced by Markov::Node< storageType >::NodeValue().
|
private |
std::vector<Edge<storageType>*> Markov::Node< storageType >::edgesV |
|
private |