C# Class Incog.Tools.ChannelTools

A collection of tools for covert channels.
ファイルを表示 Open project: SimWitty/Incog Class Usage Examples

Public Methods

Method Description
DecodeString ( byte message ) : string

Decode a string from a covert channel by removing the leading and trailing control characters.

EncodeString ( string message ) : byte[]

Encode a string for inclusion in a covert channel by adding a leading and trailing control characters.

MathSetLinear ( uint minimum, uint length ) : uint[]

Get a mathematical set of linear values starting a minimum value. For example, if the minimum is 5 and the length is 5, the resulting set would be: { 5, 6, 7, 8, 9 }

MathSetRandom ( uint minimum, uint maximum ) : uint[]

Get a mathematical set of non-repeating random values between a minimum and maximum. For example, if the minimum is 1, the maximum is 10, and the length is 5, the resulting set would be: { 1, 5, 9, 4, 2 }

MathSetRandom ( uint minimum, uint maximum, uint length ) : uint[]

Get a mathematical set of non-repeating random values between a minimum and maximum. For example, if the minimum is 1, the maximum is 10, and the length is 5, the resulting set would be: { 1, 5, 9, 4, 2 }

MathSetSieveOfEratosthenes ( uint minimum, uint maximum, uint length ) : uint[]

Get a mathematical set of prime numbers using the Sieve of Eratosthenes algorithm.

Private Methods

Method Description
SafeConvertToInt ( uint value ) : int

Convert a unsigned integer to an integer without an System.OverflowException. If the unsigned integer is greater than integer's maximum value, then the resulting integer is maximum value.

Method Details

DecodeString() public static method

Decode a string from a covert channel by removing the leading and trailing control characters.
public static DecodeString ( byte message ) : string
message byte The message string that will was sent.
return string

EncodeString() public static method

Encode a string for inclusion in a covert channel by adding a leading and trailing control characters.
public static EncodeString ( string message ) : byte[]
message string The message string that will be sent.
return byte[]

MathSetLinear() public static method

Get a mathematical set of linear values starting a minimum value. For example, if the minimum is 5 and the length is 5, the resulting set would be: { 5, 6, 7, 8, 9 }
public static MathSetLinear ( uint minimum, uint length ) : uint[]
minimum uint The first number in the set.
length uint The total array length of the resulting set.
return uint[]

MathSetRandom() public static method

Get a mathematical set of non-repeating random values between a minimum and maximum. For example, if the minimum is 1, the maximum is 10, and the length is 5, the resulting set would be: { 1, 5, 9, 4, 2 }
public static MathSetRandom ( uint minimum, uint maximum ) : uint[]
minimum uint The minimum value in the set. No values returned will be lower than this value.
maximum uint The maximum value in the set. No values returned will be higher than this value.
return uint[]

MathSetRandom() public static method

Get a mathematical set of non-repeating random values between a minimum and maximum. For example, if the minimum is 1, the maximum is 10, and the length is 5, the resulting set would be: { 1, 5, 9, 4, 2 }
public static MathSetRandom ( uint minimum, uint maximum, uint length ) : uint[]
minimum uint The minimum value in the set. No values returned will be lower than this value.
maximum uint The maximum value in the set. No values returned will be higher than this value.
length uint The total array length of the resulting set.
return uint[]

MathSetSieveOfEratosthenes() public static method

Get a mathematical set of prime numbers using the Sieve of Eratosthenes algorithm.
public static MathSetSieveOfEratosthenes ( uint minimum, uint maximum, uint length ) : uint[]
minimum uint The minimum value in the set. No values returned will be lower than this value.
maximum uint The maximum value in the set. No values returned will be higher than this value.
length uint The total array length of the resulting set.
return uint[]