-
Notifications
You must be signed in to change notification settings - Fork 0
/
RSAManager.xaml
131 lines (131 loc) · 5.7 KB
/
RSAManager.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<Window x:Class="InformationSecurity.RSAManager"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:InformationSecurity"
mc:Ignorable="d"
Title="Лабка ИБ — Шифрование RSA 16k" Height="500" Width="800">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel
Grid.Row="0"
Orientation="Horizontal"
HorizontalAlignment="Stretch"
>
<Button
x:Name="btnSave"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"
Content="Сохранить изменения таблицы"
Click="btnSave_Click"
/>
<Button
x:Name="btnReturn"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"
Margin="5,0,0,0"
Content="Выйти"
Click="btnReturn_Click"
/>
</StackPanel>
<DataGrid
Grid.Row="1"
VerticalScrollBarVisibility="Auto"
VerticalAlignment="Top"
AutoGenerateColumns="False"
IsTextSearchEnabled="True"
CanUserDeleteRows="False"
CanUserAddRows="False"
CanUserSortColumns="True"
x:Name="dgData"
>
<DataGrid.Columns>
<DataGridTextColumn x:Name="clmLogin" Binding="{Binding user, UpdateSourceTrigger=PropertyChanged}" Header="Логин"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding message, UpdateSourceTrigger=PropertyChanged}" Header="Сообщение"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding cipher, UpdateSourceTrigger=PropertyChanged}" Header="Шифр"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding open_exponent, UpdateSourceTrigger=PropertyChanged}" Header="Открытая экспонента"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding closed_exponent, UpdateSourceTrigger=PropertyChanged}" Header="Закрытая экспонента"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding multiplication, UpdateSourceTrigger=PropertyChanged}" Header="Произведение простых"/>
</DataGrid.Columns>
</DataGrid>
<StackPanel
Grid.Row="2"
VerticalAlignment="Bottom" >
<StackPanel
Orientation="Horizontal"
HorizontalAlignment="Stretch" >
<Button
Content="Шифровать"
x:Name="btnCipher"
Click="btnCipher_Click"
/>
<Button
Content="Дешифровать"
Margin="5,0,0,0"
x:Name="btnDecipher"
Click="btnDecipher_Click"
/>
<Button
Content="Сохранить данные в таблицу"
Margin="5,0,0,0"
x:Name="btnSaveToTable"
Click="btnSaveToTable_Click"
/>
<Button
Content="Сгенерировать случайные числа"
Margin="5,0,0,0"
x:Name="btnGetRandomKeys"
Click="btnGetRandomKeys_Click"
/>
</StackPanel>
<TextBox
x:Name="txtOpenExponent"
Text="Открытая экспонента"
ToolTip="Открытая экспонента"
GotFocus="TextBox_GotFocus"
LostFocus="TextBox_LostFocus"
/>
<TextBox
x:Name="txtClosedExponent"
Text="Закрытая экспонента"
ToolTip="Закрытая экспонента"
GotFocus="TextBox_GotFocus"
LostFocus="TextBox_LostFocus"
/>
<TextBox
x:Name="txtMultiplication"
Text="Произведение простых чисел"
ToolTip="Произведение простых чисел"
GotFocus="TextBox_GotFocus"
LostFocus="TextBox_LostFocus"
/>
<ScrollViewer CanContentScroll="True" Height="60">
<TextBox
x:Name="txtInput"
VerticalAlignment="Stretch"
TextWrapping="Wrap"
Text="Текст"
ToolTip="Текст"
GotFocus="TextBox_GotFocus"
LostFocus="TextBox_LostFocus"
/>
</ScrollViewer>
<ScrollViewer CanContentScroll="True" Height="60">
<TextBox
x:Name="txtOutput"
VerticalAlignment="Stretch"
TextWrapping="Wrap"
Text="Шифр"
ToolTip="Шифр"
GotFocus="TextBox_GotFocus"
LostFocus="TextBox_LostFocus"
/>
</ScrollViewer>
</StackPanel>
</Grid>
</Window>