Changeset 897 for trunk/CrypPlugins/MD5


Ignore:
Timestamp:
Nov 24, 2009, 4:48:06 PM (12 years ago)
Author:
pretzsch
Message:

+ MD5 plugin: Work on presentation

Location:
trunk/CrypPlugins/MD5
Files:
2 added
13 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/MD5/MD5.csproj

    r895 r897  
    7979      <DependentUpon>HashAccumulatorDisplay.xaml</DependentUpon>
    8080    </Compile>
     81    <Compile Include="Presentation\Displays\CompressionVariableDisplay.xaml.cs">
     82      <DependentUpon>CompressionVariableDisplay.xaml</DependentUpon>
     83    </Compile>
    8184    <Compile Include="Presentation\Displays\LabelledIntegerDisplay.xaml.cs">
    8285      <DependentUpon>LabelledIntegerDisplay.xaml</DependentUpon>
     86    </Compile>
     87    <Compile Include="Presentation\Displays\RoundAndStepDisplay.xaml.cs">
     88      <DependentUpon>RoundAndStepDisplay.xaml</DependentUpon>
    8389    </Compile>
    8490    <Compile Include="Presentation\Displays\StateDescriptionDisplay.xaml.cs">
     
    178184      <Generator>MSBuild:Compile</Generator>
    179185    </Page>
     186    <Page Include="Presentation\Displays\CompressionVariableDisplay.xaml">
     187      <Generator>MSBuild:Compile</Generator>
     188      <SubType>Designer</SubType>
     189    </Page>
    180190    <Page Include="Presentation\Displays\LabelledIntegerDisplay.xaml">
    181191      <Generator>MSBuild:Compile</Generator>
    182192      <SubType>Designer</SubType>
     193    </Page>
     194    <Page Include="Presentation\Displays\RoundAndStepDisplay.xaml">
     195      <SubType>Designer</SubType>
     196      <Generator>MSBuild:Compile</Generator>
    183197    </Page>
    184198    <Page Include="Presentation\Displays\StateDescriptionDisplay.xaml">
  • trunk/CrypPlugins/MD5/Presentation/Converters/MD5StateDescriptionToStringConverter.cs

    r895 r897  
    3333                case MD5StateDescription.ADDED_LENGTH:
    3434                    return "Added the data length";
     35                case MD5StateDescription.FINISHED_PADDING:
     36                    return "Finished padding";
    3537                case MD5StateDescription.STARTING_COMPRESSION:
    3638                    return "Starting the compression";
  • trunk/CrypPlugins/MD5/Presentation/Displays/CompressionVariableDisplay.xaml

    r895 r897  
    1 <UserControl x:Class="Cryptool.MD5.Presentation.Displays.HashAccumulatorDisplay"
     1<UserControl x:Class="Cryptool.MD5.Presentation.Displays.CompressionVariableDisplay"
    22    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    33    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     
    1010            <ColumnDefinition/>
    1111        </Grid.ColumnDefinitions>
    12         <displays:LabelledIntegerDisplay Grid.Column="0" Caption="H1" Value="{Binding H1}"/>
    13         <displays:LabelledIntegerDisplay Grid.Column="1" Caption="H2" Value="{Binding H2}"/>
    14         <displays:LabelledIntegerDisplay Grid.Column="2" Caption="H3" Value="{Binding H3}"/>
    15         <displays:LabelledIntegerDisplay Grid.Column="3" Caption="H4" Value="{Binding H4}"/>
     12        <displays:LabelledIntegerDisplay Grid.Column="0" Caption="A" Value="{Binding A}"/>
     13        <displays:LabelledIntegerDisplay Grid.Column="1" Caption="B" Value="{Binding B}"/>
     14        <displays:LabelledIntegerDisplay Grid.Column="2" Caption="C" Value="{Binding C}"/>
     15        <displays:LabelledIntegerDisplay Grid.Column="3" Caption="D" Value="{Binding D}"/>
    1616    </Grid>
    1717</UserControl>
  • trunk/CrypPlugins/MD5/Presentation/Displays/CompressionVariableDisplay.xaml.cs

    r895 r897  
    1818    /// Interaktionslogik für HashAccumulatorDisplay.xaml
    1919    /// </summary>
    20     public partial class HashAccumulatorDisplay : UserControl
     20    public partial class CompressionVariableDisplay : UserControl
    2121    {
    22         public HashAccumulatorDisplay()
     22        public CompressionVariableDisplay()
    2323        {
    2424            InitializeComponent();
  • trunk/CrypPlugins/MD5/Presentation/States/AddedPaddingBytesPresentation.xaml

    r895 r897  
    55    xmlns:displays="clr-namespace:Cryptool.MD5.Presentation.Displays">
    66    <Grid>
    7         <TextBlock Margin="12,128,12,0" Name="label1" Height="28" VerticalAlignment="Top" Text="We have added the padding bytes and our data now looks like this:"></TextBlock>
    8         <displays:DataBlockDisplay Data="{Binding CurrentState.CurrentDataBlock}" Margin="12,162,12,0" Height="88" VerticalAlignment="Top" />
     7        <TextBlock Margin="12,100,12,0" Name="label1" Height="28" VerticalAlignment="Top" Text="We have added the padding bytes and our data now looks like this:"></TextBlock>
     8        <displays:DataBlockDisplay Data="{Binding CurrentState.CurrentDataBlock}" Margin="12,134,12,0" Height="88" VerticalAlignment="Top" />
    99    </Grid>
    1010</UserControl>
  • trunk/CrypPlugins/MD5/Presentation/States/AddingLengthPresentation.xaml

    r895 r897  
    77                   " TextWrapping="Wrap" Height="47" VerticalAlignment="Top" />
    88        <TextBlock Height="61" Margin="12,0,12,55" Name="textBlock2" Text="In the next step, we write the little-endian representation of this value into the next 8 bytes of our data buffer." TextWrapping="Wrap" VerticalAlignment="Bottom" />
    9         <Label Margin="12,116,12,0" Name="label1" Height="28" VerticalAlignment="Top" Content="{Binding CurrentState.DataLength}" FontSize="18" />
     9        <Label Margin="12,116,12,0" Name="label1" Height="40" VerticalAlignment="Top" Content="{Binding CurrentState.LengthInBit}" FontSize="18" />
    1010    </Grid>
    1111</UserControl>
  • trunk/CrypPlugins/MD5/Presentation/States/AddingPaddingBytesPresentation.xaml

    r895 r897  
    66    <Grid>
    77        <displays:DataBlockDisplay Data="{Binding CurrentState.CurrentDataBlock}" Height="40" Margin="12,43,12,0" VerticalAlignment="Top" />
    8         <TextBlock Margin="12,89,12,0" Name="textBlock1" Text="We start the padding process by appending one single '1' bit to the end of our data. Since we are working with octets, this is the same as adding a '10000000' octet, thus, a byte with value 0x08, to the end of our data." TextWrapping="Wrap" Height="71" VerticalAlignment="Top" />
     8        <TextBlock Margin="12,89,12,0" Name="textBlock1" Text="and start the padding process by appending one single '1' bit to the end of our data. Since we are working with octets, this is the same as adding a '10000000' octet, thus, a byte with value 0x08, to the end of our data." TextWrapping="Wrap" Height="71" VerticalAlignment="Top" />
    99        <TextBlock Margin="12,166,12,0" Name="textBlock2" Text="We continue by appending zero bytes to the data. We choose the number of zero bytes so that our resulting data length is 8 bytes short of the next multiple of 64. That way, we can append 8 bytes more and get an exact multiple of 64 as our data length." TextWrapping="Wrap" Height="91" VerticalAlignment="Top" />
    10         <TextBlock Height="25" Margin="12,12,12,0" Name="textBlock3" Text="This is the data we have read:" TextWrapping="Wrap" VerticalAlignment="Top" />
     10        <TextBlock Height="25" Margin="12,12,12,0" Name="textBlock3" Text="We take the incomplete block of data that we've read," TextWrapping="Wrap" VerticalAlignment="Top" />
    1111    </Grid>
    1212</UserControl>
  • trunk/CrypPlugins/MD5/Presentation/States/FinishedCompressionPresentation.xaml

    r895 r897  
    22    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    33    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    4     Height="300" Width="300">
     4    Height="378" Width="570" xmlns:my="clr-namespace:Cryptool.MD5.Presentation.Displays">
    55    <Grid>
    6            
     6        <my:HashAccumulatorDisplay DataContext="{Binding LastState}" Height="50" Margin="10,10,12,0" VerticalAlignment="Top" />
     7        <my:CompressionVariableDisplay DataContext="{Binding LastState}" Margin="10,101,12,0" Height="50" VerticalAlignment="Top" />
     8        <my:HashAccumulatorDisplay DataContext="{Binding CurrentState}" Height="50" Margin="10,191,12,0" VerticalAlignment="Top">
     9        </my:HashAccumulatorDisplay>
     10        <Label Height="28" HorizontalContentAlignment="Center" Margin="10,67,12,0" Name="label1" VerticalAlignment="Top" VerticalContentAlignment="Center">+</Label>
     11        <Label HorizontalContentAlignment="Center" Margin="10,157,12,0" Name="label2" Height="28" VerticalAlignment="Top">=</Label>
     12        <TextBlock Height="21" Margin="12,0,12,100" Name="textBlock1" VerticalAlignment="Bottom" Text="We have finished the compression and updated our accumulators." />
    713    </Grid>
    814</UserControl>
  • trunk/CrypPlugins/MD5/Presentation/States/FinishedPaddingPresentation.xaml

    r895 r897  
    55    <Grid>
    66        <TextBlock Height="21" Margin="12,12,12,0" Name="textBlock1" VerticalAlignment="Top" Text="We have finished padding and have" TextWrapping="Wrap" />
    7         <TextBlock Margin="12,73,12,136" Name="textBlock2" Text="bytes of data left in our buffer. We continue by calling the compression function for this input." TextWrapping="Wrap" />
    8         <Label Margin="12,39,12,0" Name="label1" Height="28" VerticalAlignment="Top" Content="{Binding CurrentState.DataLength}" FontSize="18" />
     7        <TextBlock Margin="12,85,12,124" Name="textBlock2" Text="bytes of data left in our buffer. We continue by calling the compression function for this input." TextWrapping="Wrap" />
     8        <Label Margin="12,39,12,0" Name="label1" Height="40" VerticalAlignment="Top" Content="{Binding CurrentState.DataLength}" FontSize="18" />
    99    </Grid>
    1010</UserControl>
  • trunk/CrypPlugins/MD5/Presentation/States/FinishingCompressionPresentation.xaml

    r895 r897  
    22    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    33    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    4     Height="300" Width="300">
     4    xmlns:displays="clr-namespace:Cryptool.MD5.Presentation.Displays"
     5    Height="382" Width="506">
    56    <Grid>
    6            
     7        <TextBlock Margin="12,12,12,0" Name="textBlock1" Text="We have finished with the last round of the compression. Now it's time to update our accumulators. We do this by simply adding the variables A - D to them." TextWrapping="Wrap" Height="39" VerticalAlignment="Top" />
     8        <displays:HashAccumulatorDisplay DataContext="{Binding CurrentState}" Height="51" Margin="12,57,12,0" VerticalAlignment="Top" />
     9        <displays:CompressionVariableDisplay DataContext="{Binding CurrentState}" Margin="12,148,12,0" Height="51" VerticalAlignment="Top" />
     10        <displays:HashAccumulatorDisplay Height="51" Margin="12,239,12,0" VerticalAlignment="Top">
     11            <displays:HashAccumulatorDisplay.Effect>
     12                <BlurEffect></BlurEffect>
     13            </displays:HashAccumulatorDisplay.Effect>
     14        </displays:HashAccumulatorDisplay>
     15        <Label Margin="12,114,12,0" Name="label1" Height="28" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center">+</Label>
     16        <Label Height="28" Margin="12,205,12,0" Name="label2" VerticalAlignment="Top" HorizontalContentAlignment="Center">=</Label>
    717    </Grid>
    818</UserControl>
  • trunk/CrypPlugins/MD5/Presentation/States/InitializedPresentation.xaml

    r895 r897  
    44    xmlns:displays="clr-namespace:Cryptool.MD5.Presentation.Displays" Height="306" Width="994">
    55    <Grid>
    6         <displays:HashAccumulatorDisplay Margin="8,106,8,110" DataContext="{Binding CurrentState}" />
     6        <displays:HashAccumulatorDisplay Margin="8,106,8,0" DataContext="{Binding CurrentState}" Height="90" VerticalAlignment="Top" />
    77        <TextBlock Margin="8,250,8,0" Name="label1" Height="44" VerticalAlignment="Top" Text="The first thing we do is initialize our accumulators to their starting values, which are the fixed constants that you can see above." TextWrapping="Wrap" />
    88        <TextBlock Height="64" Margin="12,12,12,0" Name="label2" VerticalAlignment="Top" TextWrapping="Wrap" Text="The variables H1 - H4 are our accumulator variables. While we perform the hash, we will change them after each execution of the compression function. When we are done, they contain the final MD5 hash value." />
  • trunk/CrypPlugins/MD5/Presentation/States/ReadDataPresentation.xaml

    r895 r897  
    55    <Grid>
    66        <TextBlock Height="28" Margin="12,12,12,0" Name="label1" VerticalAlignment="Top">We have read a total of</TextBlock>
    7         <Label Height="28" Margin="12,46,12,0" Name="label2" VerticalAlignment="Top" Content="{Binding CurrentState.DataLength}" FontSize="18" />
    8         <TextBlock Height="28" Margin="12,80,12,0" Name="label3" VerticalAlignment="Top">bytes of data.</TextBlock>
    9         <TextBlock Margin="12,114,12,0" Name="label4" Height="28" VerticalAlignment="Top">The data block we have read looks like this:</TextBlock>
    10         <displays:DataBlockDisplay Data="{Binding CurrentState.CurrentDataBlock}" Margin="12,0,12,12" Height="84" VerticalAlignment="Bottom" />
     7        <Label Height="40" Margin="12,46,12,0" Name="label2" VerticalAlignment="Top" Content="{Binding CurrentState.DataLength}" FontSize="18" />
     8        <TextBlock Margin="12,92,12,0" Name="label3" Height="28" VerticalAlignment="Top">bytes of data.</TextBlock>
     9        <TextBlock Margin="12,126,12,0" Name="label4" Height="28" VerticalAlignment="Top">The data block we have read looks like this:</TextBlock>
     10        <displays:DataBlockDisplay Data="{Binding CurrentState.CurrentDataBlock}" Margin="12,160,12,0" Height="60" VerticalAlignment="Top" />
    1111    </Grid>
    1212</UserControl>
  • trunk/CrypPlugins/MD5/Presentation/States/ReadingDataPresentation.xaml

    r895 r897  
    55        <TextBlock Margin="12,12,12,0" Name="textBox1" TextWrapping="Wrap" Text="We continue by reading the next block of data." Height="43" VerticalAlignment="Top" />
    66        <TextBlock Height="23" Margin="12,61,12,0" Name="textBlock1" Text="So far, we have processed" TextWrapping="Wrap" VerticalAlignment="Top" />
    7         <Label Height="28" Margin="12,90,12,0" Name="label1" VerticalAlignment="Top" Content="{Binding CurrentState.BytesHashed}" FontSize="18" />
    8         <TextBlock Margin="12,124,12,116" Name="textBlock2" Text="bytes of data." TextWrapping="Wrap" />
    9         <TextBlock Height="89" Margin="12,0,12,21" Name="textBlock3" Text="The compression function of MD5 processes data in blocks of 64 bytes. Our goal is to read enough data that we can call the compression function afterwards. Thus, we continue reading as many bytes as possible until we have 64." TextWrapping="Wrap" VerticalAlignment="Bottom" />
     7        <Label Height="40" Margin="12,90,12,0" Name="label1" VerticalAlignment="Top" Content="{Binding CurrentState.BytesHashed}" FontSize="18" />
     8        <TextBlock Margin="12,136,12,0" Name="textBlock2" Text="bytes of data." TextWrapping="Wrap" Height="23" VerticalAlignment="Top" />
     9        <TextBlock Height="89" Margin="12,165,12,0" Name="textBlock3" Text="The compression function of MD5 processes data in blocks of 64 bytes. Our goal is to so much data that we can immediately call the compression function afterwards. Thus, we continue reading as many bytes as possible until we have 64." TextWrapping="Wrap" VerticalAlignment="Top" />
    1010    </Grid>
    1111</UserControl>
  • trunk/CrypPlugins/MD5/Presentation/States/StartingCompressionPresentation.xaml

    r895 r897  
    22    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    33    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     4    xmlns:displays="clr-namespace:Cryptool.MD5.Presentation.Displays"
    45    Height="360" Width="628">
    56    <Grid>
    6            
     7        <TextBlock Height="21" Margin="12,12,12,0" Name="textBlock1" VerticalAlignment="Top" Text="We now start the compression function for our next data block," />
     8        <displays:DataBlockDisplay Data="{Binding CurrentState.CurrentDataBlock}" Height="38" Margin="12,39,12,0" VerticalAlignment="Top" />
     9        <TextBlock Height="43" Margin="12,83,12,0" Name="textBlock2" Text="The compression function operates on 32 bit integers. There are 4 temporary variables A, B, C and D, which are permutated during the compression. They are initialized with the values from H1 - H4." VerticalAlignment="Top" TextWrapping="Wrap" />
     10        <displays:HashAccumulatorDisplay DataContext="{Binding CurrentState}" Margin="12,132,0,0" Height="34" HorizontalAlignment="Left" VerticalAlignment="Top" Width="272" />
     11        <displays:CompressionVariableDisplay DataContext="{Binding CurrentState}" Margin="0,132,12,0" Height="34" HorizontalAlignment="Right" VerticalAlignment="Top" Width="272" />
     12        <Label Margin="290,132,290,0" Name="label1" Height="34" VerticalAlignment="Top" VerticalContentAlignment="Center" HorizontalContentAlignment="Center">>>></Label>
    713    </Grid>
    814</UserControl>
  • trunk/CrypPlugins/MD5/Presentation/States/StartingPaddingPresentation.xaml

    r895 r897  
    55    <Grid>
    66        <TextBlock Height="28" Margin="12,67,12,0" Name="label1" VerticalAlignment="Top">Since we read only</TextBlock>
    7         <Label Height="28" Margin="12,101,0,0" Name="label2" VerticalAlignment="Top" Content="{Binding CurrentState.DataLength}" HorizontalAlignment="Left" Width="120" FontSize="18" />
    8         <TextBlock Height="28" Margin="12,135,12,0" Name="label3" VerticalAlignment="Top" TextWrapping="Wrap">bytes of data in the previous step, we have to conclude that we reached the end of our data.</TextBlock>
    9         <TextBlock Margin="12,199,12,0" TextWrapping="Wrap" Height="104" VerticalAlignment="Top">We can now begin the padding process. Padding has two uses: First, it gives us the opportunity to manipulate our data until we again have blocks with a length of a multiple of 64 bytes which we can use as input. Secondly, it allows us to work the length of the data into the final hash value.</TextBlock>
     7        <Label Height="40" Margin="12,101,12,0" Name="label2" VerticalAlignment="Top" Content="{Binding CurrentState.DataLength}" FontSize="18" />
     8        <TextBlock Height="28" Margin="12,147,12,0" Name="label3" VerticalAlignment="Top" TextWrapping="Wrap" Text="bytes in the previous step, we conclude that we reached the end of our data."></TextBlock>
     9        <TextBlock Margin="12,0,12,76" TextWrapping="Wrap" Height="104" VerticalAlignment="Bottom">We can now begin the padding process. Padding has two uses: First, it gives us the opportunity to manipulate our data until we again have blocks with length of a multiple of 64 bytes. Secondly, it allows us to work the length of the data into the final hash value.</TextBlock>
    1010    </Grid>
    1111</UserControl>
Note: See TracChangeset for help on using the changeset viewer.