diff --git a/20240418/ad-20240418.pdf b/20240418/ad-20240418.pdf index 90154ee1c57ce8154e79b64bebb169bd2d0d5527..74b94ea43d474a891a6033017643e31abc4f10e9 100644 Binary files a/20240418/ad-20240418.pdf and b/20240418/ad-20240418.pdf differ diff --git a/20240418/ad-20240418.tex b/20240418/ad-20240418.tex index f65f5cd804a8c1aac1ea756b6486d350eddd385c..47e00612f63f41b86045c49c688d588a219caa2a 100644 --- a/20240418/ad-20240418.tex +++ b/20240418/ad-20240418.tex @@ -140,7 +140,7 @@ Verwenden Sie den Datentyp \lstinline{uint64_t} (oder Langzahl-Arithmetik) \item - Für Details siehe: \file{hp-20240411.txt} + Für Details siehe: \file{ad-20240411.txt} \end{itemize} \end{frame} @@ -301,7 +301,7 @@ und daß bestimmte Operationen mit Zirkel und Lineal unmöglich sind. \item asymmetrische Verschlüsselung, Signaturen:\\ - RSA, ElGamal, elliptische Kurven + RSA, ElGamal\color{gray}, elliptische Kurven \item symmetrische Verschlüsselung: AES \item diff --git a/20240418/landau-symbols-2.pdf b/20240418/landau-symbols-2.pdf deleted file mode 120000 index 6b458b6efd8e274824a6dfcaabc4b9c27d196dc4..0000000000000000000000000000000000000000 --- a/20240418/landau-symbols-2.pdf +++ /dev/null @@ -1 +0,0 @@ -../common/landau-symbols-2.pdf \ No newline at end of file diff --git a/20240418/landau-symbols-3.pdf b/20240418/landau-symbols-3.pdf deleted file mode 120000 index 46efa409b35ff5df763c744a423599cba515d886..0000000000000000000000000000000000000000 --- a/20240418/landau-symbols-3.pdf +++ /dev/null @@ -1 +0,0 @@ -../common/landau-symbols-3.pdf \ No newline at end of file diff --git a/20240418/landau-symbols.pdf b/20240418/landau-symbols.pdf deleted file mode 120000 index ca145425bf07439c680632aa0663f84be601a565..0000000000000000000000000000000000000000 --- a/20240418/landau-symbols.pdf +++ /dev/null @@ -1 +0,0 @@ -../common/landau-symbols.pdf \ No newline at end of file diff --git a/20240502/Zeichen_123.pdf b/20240502/Zeichen_123.pdf new file mode 120000 index 0000000000000000000000000000000000000000..fdbc897227df059cfda790a16555e6e417682116 --- /dev/null +++ b/20240502/Zeichen_123.pdf @@ -0,0 +1 @@ +../common/Zeichen_123.pdf \ No newline at end of file diff --git a/20240502/ad-20240502.pdf b/20240502/ad-20240502.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0ff7e26e8a93dc33f2e988cdccbfc3fd84981b49 Binary files /dev/null and b/20240502/ad-20240502.pdf differ diff --git a/20240502/ad-20240502.tex b/20240502/ad-20240502.tex new file mode 100644 index 0000000000000000000000000000000000000000..0e994dfd83b28afea2ad8c2ce5358b55f1bed17d --- /dev/null +++ b/20240502/ad-20240502.tex @@ -0,0 +1,318 @@ +% ad-20240502.pdf - Lecture Slides on Algorithms and Data Structures in C/C++ +% Copyright (C) 2018, 2019, 2020, 2021, 2022, 2023, 2024 Peter Gerwinski +% +% This document is free software: you can redistribute it and/or +% modify it either under the terms of the Creative Commons +% Attribution-ShareAlike 3.0 License, or under the terms of the +% GNU General Public License as published by the Free Software +% Foundation, either version 3 of the License, or (at your option) +% any later version. +% +% This document is distributed in the hope that it will be useful, +% but WITHOUT ANY WARRANTY; without even the implied warranty of +% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +% GNU General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this document. If not, see <http://www.gnu.org/licenses/>. +% +% You should have received a copy of the Creative Commons +% Attribution-ShareAlike 3.0 Unported License along with this +% document. If not, see <http://creativecommons.org/licenses/>. + +% README: Diskrete Mathematik: Anwendungen + +\documentclass[10pt,t]{beamer} + +\usepackage{pgslides} +\usepackage{tikz} +%\usepackage{rotating} + +\newcommand{\underconstruction}{% + \begin{picture}(0,0) + \color{black} + \put(6,-2.2){\makebox(0,0)[b]{\includegraphics[width=1.5cm]{Zeichen_123.pdf}}} + \put(6,-2.5){\makebox(0,0)[t]{\shortstack{Änderungen\\vorbehalten}}} + \end{picture}} + +\title{Algorithmen und Datenstrukturen in C/C++} +\author{Prof.\ Dr.\ rer.\ nat.\ Peter Gerwinski} +\date{2.\ Mai 2024} + +\begin{document} + +\maketitleframe + +\nosectionnonumber{\inserttitle} + +\begin{frame} + + \shownosectionnonumber + + \begin{itemize} + \item[\textbf{1}] \textbf{Einführung} + \underconstruction + \hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/ad}}} +% \item[\textbf{\color{red}i}] {\color{red}Online-Werkzeuge für Home Office, Lehre\\ +% und Kommunikation mit Unterdrückten} + \item[\textbf{2}] \textbf{Arrays und Zeiger für Fortgeschrittene} + \item[\textbf{3}] \textbf{\color{medgreen}Langzahl-Arithmetik} + \item[\textbf{4}] \textbf{\color{orange}Kryptographie} + \item[\color{red}\textbf{5}] \textbf{\color{orange}Datenkompression} + \item[\textbf{6}] \textbf{C++} + \item[\textbf{7}] \textbf{Datenorganisation} + \vspace{-\smallskipamount} + \item[\textbf{\dots}] + \end{itemize} + +\end{frame} + +\setcounter{section}{2} +\section{Langzahl-Arithmetik} + +\begin{frame} + + \showsection + + Problem: Rechnen mit ganzen Zahlen, die größer sind als das,\\ + was der Rechner normalerweise verarbeiten kann + + \bigskip + + {\large\textbf{Aufgabe: Addition langer Zahlen}\par} + \smallskip + \begin{itemize} + \item[(a)] + Überlegen Sie sich eine Datenstruktur, um eine lange Zahl zu speichern. + \item[(b)] + Schreiben Sie eine Funktion, die zwei lange Zahlen addiert. + \end{itemize} + + \bigskip + + {\large\textbf{Lösungsansätze}\par} + \smallskip + \begin{itemize} + \item + ziffernweise (z.\,B.\ Zahlen als Strings abspeichern) + \item + zu einer Zehnerpotenz-Basis (z.\,B.\ 1\,000\,000\,000) + \item + zu einer Zweierpotenz-Basis (z.\,B.\ $2^{32}$)\\ + \item + speziell: Registerbreite \textarrow\ Hardware-Unterstützung (in Assembler) + \end{itemize} + +\end{frame} + +\begin{frame} + + \showsection + + Problem: Rechnen mit ganzen Zahlen, die größer sind als das,\\ + was der Rechner normalerweise verarbeiten kann + + \medskip + + \begin{itemize} + \item + Grundrechenarten (einschließlich "`modulo"'):\\ + "`schriftlich"' rechnen + \item + \href{https://de.wikipedia.org/wiki/Binäre_Exponentiation}% + {binäre Exponentiation}:\\ + Basis fortlaufend quadrieren, ggf.\ damit multiplizieren\\ + Beispiel: $x^9 = ((x^2)^2)^2 \cdot x$ + \item + Suche nach $d$ mit $d\cdot e~\text{mod}~N = 1$:\\ + \href{https://de.wikipedia.org/wiki/Erweiterter_euklidischer_Algorithmus}% + {erweiterter euklidischer Algorithmus} + \smallskip + \arrowitem + RSA + \end{itemize} + + \bigskip + + {\large\textbf{Aufgabe: RSA effizient implementieren}\par} + \smallskip + \begin{itemize} + \item + Verwenden Sie den Datentyp \lstinline{uint64_t} + (oder Langzahl-Arithmetik) + \item + Für Details siehe: \file{hp-20240411.txt} + \end{itemize} + +\end{frame} + +\section{Kryptographie} +\subsectionnonumber{\boldmath 4.$(x^2 - 1)$\quad Der Herr der Ringe: Manchmal ist $1 + 1 = 0$.} +\subsubsectionnonumber{\boldmath 4.$(x^2 - 1).x$\quad Motivation} + +\begin{frame} + + \showsection +% \pause + \showsubsectionnonumber +% \pause + \showsubsubsectionnonumber + + Man kann auch mit sehr merkwürdigen Objekten\\ + wie mit "`ganz normalen"' Zahlen rechnen. + +% \pause + \bigskip + + Anwendungen: + \begin{itemize} + \item Funktionsweise von Computern (\textarrow\ Rechnertechnik) + \item Fehlererkennung + \item Fehlerkorrektur + \item Verschlüsselung + \item Digitale Signaturen + \end{itemize} + +\end{frame} + +\subsubsectionnonumber{\boldmath 4.$(x^2 - 1).(x + 1)$\quad Gruppen} + +\begin{frame} + + \showsection + \showsubsectionnonumber + \showsubsubsectionnonumber + + \textbf{Definition:} + Sei $G$ eine Menge, $*$ eine Verknüpfung auf $G$. + Wenn + \begin{itemize} + \item + $\forall a, b, c \in G$: $(a * b) * c = a * (b * c)$ \quad (Assoziativgesetz), + \item + $\exists e \in G$: $\forall a \in G$: $a * e = e * a = a$ \quad (neutrales Element), + \item + $\forall a \in G$: $\exists a^{-1} \in G$: $a * a^{-1} = a^{-1} * a = e$ \quad (inverses Element), + \end{itemize} + dann heißt $(G,*)$ eine \newterm{Gruppe}. + +% \pause + \bigskip + + \textbf{Definition:} + Sei $(G,*)$ eine Gruppe. + Wenn zusätzlich + \begin{itemize} + \item + $\forall a, b \in G$: $a * b = b * a$ \quad (Kommutativgesetz), + \end{itemize} + dann heißt $(G,*)$ eine \newterm{kommutative Gruppe}. + +\end{frame} + +\subsubsectionnonumber{\boldmath 4.$(x^2 - 1).(x + 2)$\quad Ringe} + +\begin{frame} + +% \showsection + \showsubsectionnonumber + \showsubsubsectionnonumber + + \textbf{Definition:} + Sei $R$ eine Menge; seien $+$ und $\cdot$ Verknüpfungen auf $R$. + Wenn + \begin{itemize} + \item + $(R,+)$ eine kommutative Gruppe ist, + \item + $\forall a, b, c \in R$: $(a \cdot b) \cdot c = a \cdot (b \cdot c)$ \quad (Assoziativgesetz), + \item + $\forall a, b, c \in R$: $(a + b)\cdot c = a\cdot c + b\cdot c$ + und $a\cdot(b + c) = a\cdot b + a\cdot c$ \quad (Distributivgesetze), + \end{itemize} + dann heißt $(R,+,\cdot)$ ein \newterm{Ring}. + +% \pause + \bigskip + + \textbf{Definition:} + Sei $(R,+,\cdot)$ ein Ring. + Wenn zusätzlich + \begin{itemize} + \item + $\forall a, b \in R$: $a \cdot b = b \cdot a$ \quad (Kommutativgesetz), + \end{itemize} + dann heißt $(R,+,\cdot)$ ein \newterm{kommutativer Ring}. + +% \pause + \bigskip + + \textbf{Definition:} + Sei $(R,+,\cdot)$ ein (kommutativer) Ring. + Wenn zusätzlich + \begin{itemize} + \item + ein $e \in R$ existiert, so daß für alle $a \in R$ gilt: $a \cdot e = e \cdot a = a$\\ + (neutrales Element), + \end{itemize} + dann heißt $(R,+,\cdot)$ ein \newterm{(kommutativer) Ring mit 1}. + + \vspace*{-1cm} + +\end{frame} + +\subsubsectionnonumber{\boldmath 4.$(x^2 - 1).(x + 3)$\quad Körper} + +\begin{frame} + +% \showsection + \showsubsectionnonumber + \showsubsubsectionnonumber + + \textbf{Definition:} + Sei $K$ eine Menge; seien $+$ und $\cdot$ Verknüpfungen auf $K$. + Wenn + \begin{itemize} + \item + $(K,+,\cdot)$ ein Ring mit 1 ist und + \item + $(K \backslash \{0\},\cdot)$ eine kommutative Gruppe ist, + \end{itemize} + dann heißt $(K,+,\cdot)$ ein \newterm{Körper}. + +\end{frame} + +\subsubsectionnonumber{\boldmath 4.$(x^2 - 1).(x + 4)$\quad Anwendungen} + +\begin{frame} + +% \showsection + \showsubsectionnonumber + \showsubsubsectionnonumber + + Man kann auch mit sehr merkwürdigen Objekten\\ + wie mit "`ganz normalen"' Zahlen rechnen. + + \bigskip + + \begin{itemize} + \item + innermathematisch: Man kann beweisen,\\ + daß es ab $x^5$ keine "`$p$-$q$-Formel"' mehr gibt\\ + und daß bestimmte Operationen mit Zirkel und Lineal unmöglich sind. + \item + asymmetrische Verschlüsselung, Signaturen:\\ + RSA, ElGamal\color{red}, elliptische Kurven + \item + symmetrische Verschlüsselung: AES + \item + Fehlererkennung: Parität, CRC\\ + Anwendungen: Datenübertragung, RAID + \item + Fehlerkorrektur: Reed-Solomon\\ + Anwendungen: Raumsonden, optische Datenträger, ECC-RAM + \end{itemize} + +\end{frame} + +\end{document} diff --git a/20240502/ad-20240502.txt b/20240502/ad-20240502.txt new file mode 100644 index 0000000000000000000000000000000000000000..5aa8b807983eaca0db0aa2f0cdb3711e7aa531e5 --- /dev/null +++ b/20240502/ad-20240502.txt @@ -0,0 +1,21 @@ +18.04.2024 +~~~~~~~~~~ + - Erweiterter euklidischer Algorithmus + - Nutzung von ChatGPT für die Fehlersuche + - diskreter Logarithmus: Diffie-Hellman, ElGamal + --> gruppen-ringe-koerper-2-05-elgamal-und-diffie-hellman.png + +25.04.2024 +~~~~~~~~~~ + - Kompression am Beispiel RDP (VNC, RFC 6143, yesVNC) + - Lasttest für PULT (Mumble, VNC, CVHCamera) + - Sicherheitsüberlegunen zu PULT: + https://www.bsi.bund.de/SharedDocs/Downloads/DE/BSI/Grundschutz/Kompendium_Einzel_PDFs/03_CON_Konzepte_und_Vorgehensweisen/CON_5_Entwicklung_Einsatz_von_Individualsoftware_Edition_2020.pdf?__blob=publicationFile&v=2 + +02.05.2024 +~~~~~~~~~~ + - yesVNC (Fortsetzung) + - Skripte zur allgemeinen Nutzung von Online-Plattformen + (s, mic, Weiterentwicklung: VNC Vollbild) + - weitere Anwendungen diskreter Mathematik: + elliptische Kurven, AES, Fehlererkennung und -korrektur diff --git a/20240502/logo-hochschule-bochum-cvh-text.pdf b/20240502/logo-hochschule-bochum-cvh-text.pdf new file mode 120000 index 0000000000000000000000000000000000000000..a05946126bc0ce6a2818740da2893f59eb0c659c --- /dev/null +++ b/20240502/logo-hochschule-bochum-cvh-text.pdf @@ -0,0 +1 @@ +../common/logo-hochschule-bochum-cvh-text.pdf \ No newline at end of file diff --git a/20240502/logo-hochschule-bochum.pdf b/20240502/logo-hochschule-bochum.pdf new file mode 120000 index 0000000000000000000000000000000000000000..b6b9491e370e499c9276918182cdb82cb311bcd1 --- /dev/null +++ b/20240502/logo-hochschule-bochum.pdf @@ -0,0 +1 @@ +../common/logo-hochschule-bochum.pdf \ No newline at end of file diff --git a/20240502/pgslides.sty b/20240502/pgslides.sty new file mode 120000 index 0000000000000000000000000000000000000000..5be1416f4216f076aa268901f52a15d775e43f64 --- /dev/null +++ b/20240502/pgslides.sty @@ -0,0 +1 @@ +../common/pgslides.sty \ No newline at end of file