Skip to content

Commit b1f9e39

Browse files
Schecher_1Schecher_1
authored andcommitted
Version 1.1.0.0 is now officially released
1 parent b91b254 commit b1f9e39

6 files changed

Lines changed: 66 additions & 12 deletions

File tree

CaesarCipher_Playground.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
<ItemGroup>
1717
<Folder Include="Classes\" />
18+
<Folder Include="IMAGES\Version 1.1.0.0\" />
1819
</ItemGroup>
1920

2021
</Project>
47.7 KB
Loading

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ course also import and export the specific keys.<br/><br/>
1111
## How to Download:
1212

1313
Go to the "Releases" and download any version.<br/><br/>
14-
Or [press here](https://github.com/Schecher1/CaesarCipher-Playground/releases/download/CaesarCipher-Playground-Ver-1.0.0.0/CaesarCipher_Playground-Standalone.zip) to download if you want the latest one as standalone<br/>
14+
Or [press here](https://github.com/Schecher1/CaesarCipher-Playground/releases/download/CaesarCipher-Playground-Ver-1.1.0.0/CaesarCipher_Playground-Standalone.zip) to download if you want the latest one as standalone<br/>
1515

16-
Or [press here](https://github.com/Schecher1/CaesarCipher-Playground/releases/download/CaesarCipher-Playground-Ver-1.0.0.0/CaesarCipher_Playground-NotStandalone.zip) to download if you want the latest one as not standalone<br/>
16+
Or [press here](https://github.com/Schecher1/CaesarCipher-Playground/releases/download/CaesarCipher-Playground-Ver-1.1.0.0/CaesarCipher_Playground-NotStandalone.zip) to download if you want the latest one as not standalone<br/>
1717

1818
"Standalone" is optimal if there is NO .NET 6 on this machine. (is bigger)<br/>
1919
"Not Standalone" is good if there is .NET 6 on this machine. (is smaller)<br/>
@@ -22,6 +22,7 @@ Or [press here](https://github.com/Schecher1/CaesarCipher-Playground/releases/do
2222
## Features:
2323
✔️ encrypt and decrypt texts<br/>
2424
✔️ import and export the specific keys<br/>
25+
✔️ encryption key can also be generated randomly<br/>
2526
✔️ user-friendly / beginner-friendly<br/>
2627
✔️ requires NO installation, just start it<br/>
2728

@@ -33,10 +34,15 @@ Or [press here](https://github.com/Schecher1/CaesarCipher-Playground/releases/do
3334
![Decryptor](IMAGES/Version%201.0.0.0/Decryptor.PNG)
3435

3536
### Key-Manager:
36-
![KeyManager](IMAGES/Version%201.0.0.0/KeyManager.PNG)
37+
![KeyManager](IMAGES/Version%201.1.0.0/KeyManager.PNG)
3738

3839
# CHANGELOG
3940
## v1.0.0.0
4041
- The program has an absolutely basic design
4142
- The encryption key can be changed at will
4243
- The key can be exported and imported
44+
45+
## v1.1.0.0
46+
- Added 2 buttons to the Key Manager
47+
- Your encryption key can now also be generated randomly
48+
- Your encryption key can now also be cleared.

Windows/CaesarCipherKeyWindow.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<Separator/>
1919
<Button x:Name="Bttn_Normal" Content="CaesarCipher-Key-Normal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="Bttn_Normal_Click"/>
2020
<Button x:Name="Bttn_Twisted" Content="CaesarCipher-Key-Twisted" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="Bttn_Twisted_Click" />
21+
<Button x:Name="Bttn_Random" Content="CaesarCipher-Key-Random" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="Bttn_Random_Click" />
22+
<Button x:Name="Bttn_Clear" Content="CaesarCipher-Key-Clear" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="Bttn_Clear_Click" />
2123
</ToolBar>
2224
</ToolBarPanel>
2325

Windows/CaesarCipherKeyWindow.xaml.cs

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using System.IO;
4+
using System.Linq;
35
using System.Windows;
46
using System.Windows.Controls;
57
using System.Windows.Forms;
@@ -57,8 +59,6 @@ private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs
5759

5860
private void Bttn_Normal_Click(object sender, RoutedEventArgs e)
5961
{
60-
61-
6262
TextBox[] letterBoxes = GetAllTextboxes();
6363
int counter = 0;
6464

@@ -67,13 +67,9 @@ private void Bttn_Normal_Click(object sender, RoutedEventArgs e)
6767
letterBoxes[counter].Text = ((char)i).ToString();
6868
counter++;
6969
}
70-
71-
7270
}
7371
private void Bttn_Twisted_Click(object sender, RoutedEventArgs e)
7472
{
75-
76-
7773
TextBox[] letterBoxes = GetAllTextboxes();
7874
int counter = 0;
7975

@@ -82,8 +78,55 @@ private void Bttn_Twisted_Click(object sender, RoutedEventArgs e)
8278
letterBoxes[counter].Text = ((char)i).ToString();
8379
counter++;
8480
}
81+
}
82+
private void Bttn_Random_Click(object sender, RoutedEventArgs e)
83+
{
84+
TextBox[] letterBoxes = GetAllTextboxes();
85+
List<char> usedChars = new List<char>();
86+
bool getAllChars = false;
87+
int arrayCounter = 0;
88+
int errorCounter = 0;
89+
90+
Bttn_Normal_Click(sender, e);
91+
92+
Random r = new Random();
93+
94+
while (!getAllChars)
95+
{
96+
errorCounter++;
97+
bool charAlreadyUsed = false;
98+
99+
char randomChar = (char) r.Next(65, 91);
100+
101+
foreach (char letter in usedChars)
102+
if (letter == randomChar)
103+
charAlreadyUsed = true;
104+
105+
if (letterBoxes[arrayCounter].Text != randomChar.ToString() && !charAlreadyUsed)
106+
{
107+
letterBoxes[arrayCounter].Text = randomChar.ToString();
108+
usedChars.Add(randomChar);
109+
arrayCounter++;
110+
}
111+
112+
if (arrayCounter == letterBoxes.Length)
113+
getAllChars = true;
114+
115+
//Is the cut, if the while loop gets an endless run.
116+
//(have no idea why, sometimes it works and sometimes not).
117+
if (errorCounter == 5000)
118+
{
119+
Bttn_Clear_Click(sender, e);
120+
break;
121+
}
122+
}
123+
}
124+
private void Bttn_Clear_Click(object sender, RoutedEventArgs e)
125+
{
126+
TextBox[] letterBoxes = GetAllTextboxes();
85127

86-
128+
for (int i = 0; i < letterBoxes.Length; i++)
129+
letterBoxes[i].Text = "";
87130
}
88131

89132
private void LoadKey(string path)
@@ -174,5 +217,7 @@ private TextBox[] GetAllTextboxes()
174217

175218
return letterBoxes;
176219
}
220+
221+
177222
}
178223
}

Windows/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:CaesarCipher_Playground"
77
mc:Ignorable="d"
8-
Title="CaesarCipher Playground | Made by Schecher_1 | Version 1.0.0.0"
8+
Title="CaesarCipher Playground | Made by Schecher_1 | Version 1.1.0.0"
99
Height="450" Width="800"
1010
MinHeight="400" MinWidth="400"
1111
Background="{DynamicResource {x:Static SystemColors.ActiveCaptionBrushKey}}">

0 commit comments

Comments
 (0)