Show / Hide Table of Contents

    Class Obfuscator

    Provides methods for obfuscation of documents for reduced readability and size.

    Inheritance
    System.Object
    Obfuscator
    XmlObfuscator
    Namespace: Cuemon.Security
    Assembly: Cuemon.Security.dll
    Syntax
    public abstract class Obfuscator

    Constructors

    | Improve this Doc

    Obfuscator()

    Initializes a new instance of the Obfuscator class using System.Text.Encoding.Unicode for the character encoding.

    Declaration
    protected Obfuscator()
    | Improve this Doc

    Obfuscator(IEnumerable<String>)

    Initializes a new instance of the Obfuscator class using System.Text.Encoding.Unicode for the character encoding.

    Declaration
    protected Obfuscator(IEnumerable<string> exclusions)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.String> exclusions

    A sequence of System.String values used for excluding matching original values in the obfuscation process.

    | Improve this Doc

    Obfuscator(Encoding)

    Initializes a new instance of the Obfuscator class.

    Declaration
    protected Obfuscator(Encoding encoding)
    Parameters
    Type Name Description
    System.Text.Encoding encoding

    The character encoding to use.

    | Improve this Doc

    Obfuscator(Encoding, IEnumerable<String>)

    Initializes a new instance of the Obfuscator class.

    Declaration
    protected Obfuscator(Encoding encoding, IEnumerable<string> exclusions)
    Parameters
    Type Name Description
    System.Text.Encoding encoding

    The character encoding to use.

    System.Collections.Generic.IEnumerable<System.String> exclusions

    A sequence of System.String values used for excluding matching original values in the obfuscation process.

    Properties

    | Improve this Doc

    CurrentCombinationLength

    Gets the length of the current combination used in conjuction with CurrentPermutationSize.

    Declaration
    protected byte CurrentCombinationLength { get; }
    Property Value
    Type Description
    System.Byte

    The length of the current combination used in conjuction with CurrentPermutationSize.

    | Improve this Doc

    CurrentPermutationSize

    Gets the calculated size of the current permutation used in conjuction with CurrentCombinationLength.

    Declaration
    protected int CurrentPermutationSize { get; }
    Property Value
    Type Description
    System.Int32

    The calculated size of the current permutation used in conjuction with CurrentCombinationLength.

    | Improve this Doc

    Encoding

    Gets or sets the character encoding to use.

    Declaration
    public Encoding Encoding { get; set; }
    Property Value
    Type Description
    System.Text.Encoding

    The character encoding to use. The default is System.Text.Encoding.Unicode.

    | Improve this Doc

    Exclusions

    Gets a list of exclusions for the obfuscation process.

    Declaration
    protected ICollection<string> Exclusions { get; }
    Property Value
    Type Description
    System.Collections.Generic.ICollection<System.String>

    A list of exclusions for the obfuscation process.

    | Improve this Doc

    Mappings

    Gets the generated mapping values associated with the obfuscated content.

    Declaration
    protected Dictionary<string, ObfuscatorMapping> Mappings { get; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, ObfuscatorMapping>

    The original values gathered in a mappable structure.

    | Improve this Doc

    PermutationCharacters

    Gets an System.Collections.Generic.IList<T> compatible object holding the characters initialized by InitializePermutationCharacters().

    Declaration
    protected IList<char> PermutationCharacters { get; }
    Property Value
    Type Description
    System.Collections.Generic.IList<System.Char>

    An System.Collections.Generic.IList<T> compatible object holding the characters initialized by InitializePermutationCharacters().

    Methods

    | Improve this Doc

    ComputeHash(String)

    Computes a SHA-1 hash value of the specified System.String value.

    Declaration
    protected virtual string ComputeHash(string value)
    Parameters
    Type Name Description
    System.String value

    The System.String value to compute a hash code for.

    Returns
    Type Description
    System.String

    A System.String containing the computed SHA-1 hash value of value.

    Remarks

    Do override this method if you prefer another hashing than SHA-1.

    | Improve this Doc

    CreateMapping()

    Creates and returns a mappaple format of the original values and the obfuscated values.

    Declaration
    public abstract Stream CreateMapping()
    Returns
    Type Description
    System.IO.Stream

    A mappaple format of the original values and the obfuscated values.

    | Improve this Doc

    GenerateObfuscatedValue()

    Creates and returns a random generated System.String with a factorial size of (x - CurrentCombinationLength) ideal for obfuscated usage.

    Declaration
    protected string GenerateObfuscatedValue()
    Returns
    Type Description
    System.String

    A random generated System.String with a factorial size of (x - CurrentCombinationLength) ideal for obfuscated usage, where x in the default implementation equals 62.

    Remarks

    This implementation uses the values from PermutationCharacters to compute the permutation. Using the standard implementation gives a close to limitless permutation in regards to obfuscation, as the value automatically grows when needed.

    | Improve this Doc

    InitializePermutationCharacters()

    Initializes the permutation characters used in the obfuscation process.

    Declaration
    protected virtual IList<char> InitializePermutationCharacters()
    Returns
    Type Description
    System.Collections.Generic.IList<System.Char>

    An System.Collections.Generic.IList<T> compatible object holding the permuation characters used in the obfuscation process.

    Remarks

    Override this method to implement your own initialization of permuation characters. Default implementation is initialized as a read-only System.Collections.Generic.IList<T> compatible object with the values found in AlphanumericCharactersCaseSensitive.

    | Improve this Doc

    Obfuscate(Stream)

    Obfuscates the values of the specified System.IO.Stream object.

    Declaration
    public abstract Stream Obfuscate(Stream value)
    Parameters
    Type Name Description
    System.IO.Stream value

    The System.IO.Stream object to obfuscate.

    Returns
    Type Description
    System.IO.Stream

    A System.IO.Stream object where the values has been obfuscated.

    | Improve this Doc

    Revert(Stream, Stream)

    Revert the obfuscated value of value to its original state by applying the mappaple values of mapping.

    Declaration
    public abstract Stream Revert(Stream value, Stream mapping)
    Parameters
    Type Name Description
    System.IO.Stream value

    The obfuscated System.IO.Stream to revert.

    System.IO.Stream mapping

    A System.IO.Stream containing mappaple values necessary to revert value to its original state.

    Returns
    Type Description
    System.IO.Stream

    A System.IO.Stream object where the obfuscated value has been reverted to its original value.

    Extension Methods

    ConverterExtensions.ParseWith<TSource, TResult>(TSource, Func<TSource, TResult>)
    ConverterExtensions.ParseWith<TSource, T, TResult>(TSource, Func<TSource, T, TResult>, T)
    ConverterExtensions.ParseWith<TSource, T1, T2, TResult>(TSource, Func<TSource, T1, T2, TResult>, T1, T2)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, TResult>(TSource, Func<TSource, T1, T2, T3, TResult>, T1, T2, T3)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, TResult>(TSource, Func<TSource, T1, T2, T3, T4, TResult>, T1, T2, T3, T4)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, TResult>, T1, T2, T3, T4, T5)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, TResult>, T1, T2, T3, T4, T5, T6)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, TResult>, T1, T2, T3, T4, T5, T6, T7)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, TResult>, T1, T2, T3, T4, T5, T6, T7, T8)
    ConverterExtensions.ParseWith<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>(TSource, Func<TSource, T1, T2, T3, T4, T5, T6, T7, T8, T9, TResult>, T1, T2, T3, T4, T5, T6, T7, T8, T9)
    ConverterExtensions.As<TResult>(Object)
    ConverterExtensions.As<TResult>(Object, TResult)
    ConverterExtensions.As<TResult>(Object, TResult, IFormatProvider)
    DelegateUtilityExtensions.Wrap<TResult>(TResult)
    DelegateUtilityExtensions.DynamicWrap<TResult>(TResult)
    TweakerExtensions.Adjust<T>(T, Func<T, T>)
    TypeUtilityExtensions.Is<T>(Object)
    TypeUtilityExtensions.IsNot<T>(Object)
    TypeUtilityExtensions.IsNullable<T>(T)
    WrapperExtensions.UseWrapper<T>(T, Action<IDictionary<String, Object>>)
    WrapperExtensions.UseWrapper<T>(T, MemberInfo, Action<IDictionary<String, Object>>)
    EnumerableUtilityExtensions.Yield<TSource>(TSource)
    HashUtilityExtensions.ComputeHash(Object, Action<HashOptions>)
    HmacUtilityExtensions.ComputeKeyedHash(Object, Byte[], Action<KeyedHashOptions>)
    • Improve this Doc
    • View Source
    Back to top Copyright 2008-2018 Weubphoria. All rights reserved.
    Generated by DocFX