Skip to content

Commit 9e8710e

Browse files
committed
2 parents 0080be3 + b425c54 commit 9e8710e

7 files changed

Lines changed: 256 additions & 1 deletion

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
public class Caesar {
2+
3+
public String verschlüsseln(String s, int verschiebung) {
4+
String result = "";
5+
s = s.toUpperCase();
6+
for (int i = 0; i < s.length(); i++) {
7+
char c = s.charAt(i);
8+
int asc = (int)c - (int)'A';
9+
asc = (asc + verschiebung) % 26;
10+
asc = asc + (int)'A';
11+
c = (char)asc;
12+
result = result + c;
13+
}
14+
return result;
15+
}
16+
17+
public String entschlüsseln(String s, int verschiebung) {
18+
String result = "";
19+
s = s.toUpperCase();
20+
for (int i = 0; i < s.length(); i++) {
21+
char c = s.charAt(i);
22+
int asc = (int)c - (int)'A';
23+
asc = (asc + 26 - verschiebung) % 26;
24+
asc = asc + (int)'A';
25+
c = (char)asc;
26+
result = result + c;
27+
}
28+
return result;
29+
}
30+
}
31+
32+
33+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Caesar c = new Caesar();
2+
3+
for (int i = 1; i < 26; i++) {
4+
println(i + ": " + c.verschlüsseln("Hallo", i));
5+
}
6+
println("-------------");
7+
8+
for (int i = 1; i < 26; i++) {
9+
println(i + ": " + c.entschlüsseln("YMZDNDZWZIZDIN", i));
10+
}
11+
println("-------------");
12+
13+
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Die C&auml;sar-Verschl&uuml;sselung</title>
6+
<style>
7+
/* From extension vscode.github */
8+
/*---------------------------------------------------------------------------------------------
9+
* Copyright (c) Microsoft Corporation. All rights reserved.
10+
* Licensed under the MIT License. See License.txt in the project root for license information.
11+
*--------------------------------------------------------------------------------------------*/
12+
13+
.vscode-dark img[src$=\#gh-light-mode-only],
14+
.vscode-light img[src$=\#gh-dark-mode-only],
15+
.vscode-high-contrast:not(.vscode-high-contrast-light) img[src$=\#gh-light-mode-only],
16+
.vscode-high-contrast-light img[src$=\#gh-dark-mode-only] {
17+
display: none;
18+
}
19+
20+
</style>
21+
22+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/markdown.css">
23+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Microsoft/vscode/extensions/markdown-language-features/media/highlight.css">
24+
<style>
25+
body {
26+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe WPC', 'Segoe UI', system-ui, 'Ubuntu', 'Droid Sans', sans-serif;
27+
font-size: 14px;
28+
line-height: 1.6;
29+
}
30+
</style>
31+
<style>
32+
.task-list-item {
33+
list-style-type: none;
34+
}
35+
36+
.task-list-item-checkbox {
37+
margin-left: -20px;
38+
vertical-align: middle;
39+
pointer-events: none;
40+
}
41+
</style>
42+
<style>
43+
:root {
44+
--color-note: #0969da;
45+
--color-tip: #1a7f37;
46+
--color-warning: #9a6700;
47+
--color-severe: #bc4c00;
48+
--color-caution: #d1242f;
49+
--color-important: #8250df;
50+
}
51+
52+
</style>
53+
<style>
54+
@media (prefers-color-scheme: dark) {
55+
:root {
56+
--color-note: #2f81f7;
57+
--color-tip: #3fb950;
58+
--color-warning: #d29922;
59+
--color-severe: #db6d28;
60+
--color-caution: #f85149;
61+
--color-important: #a371f7;
62+
}
63+
}
64+
65+
</style>
66+
<style>
67+
.markdown-alert {
68+
padding: 0.5rem 1rem;
69+
margin-bottom: 16px;
70+
color: inherit;
71+
border-left: .25em solid #888;
72+
}
73+
74+
.markdown-alert>:first-child {
75+
margin-top: 0
76+
}
77+
78+
.markdown-alert>:last-child {
79+
margin-bottom: 0
80+
}
81+
82+
.markdown-alert .markdown-alert-title {
83+
display: flex;
84+
font-weight: 500;
85+
align-items: center;
86+
line-height: 1
87+
}
88+
89+
.markdown-alert .markdown-alert-title .octicon {
90+
margin-right: 0.5rem;
91+
display: inline-block;
92+
overflow: visible !important;
93+
vertical-align: text-bottom;
94+
fill: currentColor;
95+
}
96+
97+
.markdown-alert.markdown-alert-note {
98+
border-left-color: var(--color-note);
99+
}
100+
101+
.markdown-alert.markdown-alert-note .markdown-alert-title {
102+
color: var(--color-note);
103+
}
104+
105+
.markdown-alert.markdown-alert-important {
106+
border-left-color: var(--color-important);
107+
}
108+
109+
.markdown-alert.markdown-alert-important .markdown-alert-title {
110+
color: var(--color-important);
111+
}
112+
113+
.markdown-alert.markdown-alert-warning {
114+
border-left-color: var(--color-warning);
115+
}
116+
117+
.markdown-alert.markdown-alert-warning .markdown-alert-title {
118+
color: var(--color-warning);
119+
}
120+
121+
.markdown-alert.markdown-alert-tip {
122+
border-left-color: var(--color-tip);
123+
}
124+
125+
.markdown-alert.markdown-alert-tip .markdown-alert-title {
126+
color: var(--color-tip);
127+
}
128+
129+
.markdown-alert.markdown-alert-caution {
130+
border-left-color: var(--color-caution);
131+
}
132+
133+
.markdown-alert.markdown-alert-caution .markdown-alert-title {
134+
color: var(--color-caution);
135+
}
136+
137+
</style>
138+
139+
</head>
140+
<body class="vscode-body vscode-light">
141+
<meta charset="utf-8" />
142+
<title>Informatik</title>
143+
<link rel="stylesheet" href="https://Hi2272.github.io/StyleMD.css">
144+
<h1 id="die-cäsar-verschlüsselung">Die Cäsar-Verschlüsselung</h1>
145+
<p>Im Rahmen der einfachen Cäsar-Verschlüsselung wird das Alphabet um eine festgelegte Anzahl Stellen verschoben.<br>
146+
Das folgende Java-Programm verschlüsselt den Begriff &quot;Hallo&quot; mit allen möglichen Verschiebungswerten und entschlüsselt die Zeichenkette &quot;YMZDNDZWZIZDIN&quot; aus <a href="https://view.genially.com/647f2a04bc62140019e744a0/interactive-content-the-mystery-of-cryptocastle">KryptoCastle</a> mit allen Werten.</p>
147+
<p>Erläutere die Funktion der Methoden.</p>
148+
<div id="quelle" style="font-size: x-small; text-align: right;">
149+
2026 Rainer Hille Unter Verwendung der <a href='https://www.online-ide.de/'>Online-IDE von Martin Pabst</a><br>Hinweis: Der Code-Editor muss erst geladen werden. Klicke ggf. auf <b>Code Reset</b> um den Programmcode neu zu laden.
150+
</div>
151+
<section>
152+
<iframe
153+
srcdoc="<script>window.jo_doc = window.frameElement.textContent;</script><script src='https://Hi2272.github.io/include/js/includeide/includeIDE.js'></script>"
154+
width="100%" height="600" frameborder="0">
155+
{'id': 'Java', 'speed': 2000,
156+
'withBottomPanel': true ,'withPCode': false ,'withConsole': true ,
157+
'withFileList': true ,'withErrorList': true}
158+
<script id="javaCode" type="plain/text" title="Caesar.java" src="Caesar.java"></script>
159+
<script id="javaCode" type="plain/text" title="Main.java" src="Main.java"></script>
160+
</script>
161+
</iframe>
162+
</section>
163+
<h2 id="weiter"><a href="../02Loesung/index.html">weiter</a></h2>
164+
<h2 id="index"><a href="../../../index.html">Index</a></h2>
165+
166+
167+
168+
</body>
169+
</html>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<meta charset="utf-8" />
2+
<title>Informatik</title>
3+
<link rel="stylesheet" href="https://Hi2272.github.io/StyleMD.css">
4+
5+
# Die Cäsar-Verschlüsselung
6+
Im Rahmen der einfachen Cäsar-Verschlüsselung wird das Alphabet um eine festgelegte Anzahl Stellen verschoben.
7+
Das folgende Java-Programm verschlüsselt den Begriff "Hallo" mit allen möglichen Verschiebungswerten und entschlüsselt die Zeichenkette "YMZDNDZWZIZDIN" aus [KryptoCastle](https://view.genially.com/647f2a04bc62140019e744a0/interactive-content-the-mystery-of-cryptocastle) mit allen Werten.
8+
9+
Erläutere die Funktion der Methoden.
10+
11+
<div id="quelle" style="font-size: x-small; text-align: right;">
12+
2026 Rainer Hille Unter Verwendung der <a href='https://www.online-ide.de/'>Online-IDE von Martin Pabst</a><br>Hinweis: Der Code-Editor muss erst geladen werden. Klicke ggf. auf <b>Code Reset</b> um den Programmcode neu zu laden.
13+
14+
</div>
15+
16+
<section>
17+
<iframe
18+
srcdoc="<script>window.jo_doc = window.frameElement.textContent;</script><script src='https://Hi2272.github.io/include/js/includeide/includeIDE.js'></script>"
19+
width="100%" height="600" frameborder="0">
20+
{'id': 'Java', 'speed': 2000,
21+
'withBottomPanel': true ,'withPCode': false ,'withConsole': true ,
22+
'withFileList': true ,'withErrorList': true}
23+
<script id="javaCode" type="plain/text" title="Caesar.java" src="Caesar.java"></script>
24+
<script id="javaCode" type="plain/text" title="Main.java" src="Main.java"></script>
25+
</script>
26+
</iframe>
27+
</section>
28+
29+
30+
## [weiter](../02Loesung/index.html)
31+
## [Index](../../../index.html)
32+

00Informatik/00Mikrocontroller/Wahlkurs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Auf Grundlage des [Scru-Fe-Roboters](https://www.thingiverse.com/thing:780050) v
162162

163163
### Platinen bauen
164164

165-
[CNC](Fritzing/CNC/index.html)
165+
00[CNC](Fritzing/CNC/index.html)
166166
[DrillEditor](Fritzing/CNC/index.html)
167167

168168
---

00Informatik/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,9 @@ <h1 id="informatik-11-klasse">Informatik 11. Klasse</h1>
329329
<a href="00Informatik11/03Breitensuche/05Algorithmus/index.html">Breitensuche Algorithmus</a><br>
330330
<a href="00Informatik11/03Breitensuche/06Warteschlange/index.html">Die Klasse Warteschlange</a><br>
331331
<a href="00Informatik11/03Breitensuche/07Implementierung/index.html">Breitensuche Implementierung</a></p>
332+
<h2 id="verschlüsselung">Verschlüsselung</h2>
333+
<p><a href="https://view.genially.com/647f2a04bc62140019e744a0/interactive-content-the-mystery-of-cryptocastle">Krypto-Castle</a><br>
334+
<a href="00Informatik11/Krypto/index.html">Cäsar-Verschlüsselung</a></p>
332335
<h1 id="datenschutz">Datenschutz</h1>
333336
<hr>
334337
<p><a href="https://Hi2272.github.io/00Informatik/KlassischeMedien/index.html">Klassische Medien</a><br>

00Informatik/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,11 @@
256256
[Breitensuche Implementierung](00Informatik11/03Breitensuche/07Implementierung/index.html)
257257

258258

259+
## Verschlüsselung
260+
[Krypto-Castle](https://view.genially.com/647f2a04bc62140019e744a0/interactive-content-the-mystery-of-cryptocastle)
261+
[Cäsar-Verschlüsselung](00Informatik11/Krypto/index.html)
262+
263+
259264
# Datenschutz
260265
***
261266

0 commit comments

Comments
 (0)