Skip to content
Snippets Groups Projects
Commit 6d346a51 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Vorbereitung 11.1.2024

parent 77737db3
No related branches found
No related tags found
No related merge requests found
Showing
with 472 additions and 23 deletions
% dbs-20221005.pdf - Lecture Slides on Databases and Information Security % dbs-20231005.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
......
% dbs-20221012.pdf - Lecture Slides on Databases and Information Security % dbs-20231012.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
......
% dbs-20221019.pdf - Lecture Slides on Databases and Information Security % dbs-20231019.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
......
% dbs-20221026.pdf - Lecture Slides on Databases and Information Security % dbs-20231026.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
......
% dbs-20221102.pdf - Lecture Slides on Databases and Information Security % dbs-20231102.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
......
% dbs-20221109.pdf - Lecture Slides on Databases and Information Security % dbs-20231109.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
......
% dbs-20221116.pdf - Lecture Slides on Databases and Information Security % dbs-20231116.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
......
% dbs-20221123.pdf - Lecture Slides on Databases and Information Security % dbs-20231123.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
......
% dbs-20221130.pdf - Lecture Slides on Databases and Information Security % dbs-20231130.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
......
% dbs-20221207.pdf - Lecture Slides on Databases and Information Security % dbs-20231207.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
......
No preview for this file type
% dbs-20221214.pdf - Lecture Slides on Databases and Information Security % dbs-20231214.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 2023 Peter Gerwinski % Copyright (C) 2023 Peter Gerwinski
% %
% This document is free software: you can redistribute it and/or % This document is free software: you can redistribute it and/or
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
% Attribution-ShareAlike 3.0 Unported License along with this % Attribution-ShareAlike 3.0 Unported License along with this
% document. If not, see <http://creativecommons.org/licenses/>. % document. If not, see <http://creativecommons.org/licenses/>.
% README: @@@ % README: GUI-Zugriff, SQL Injection
\documentclass[10pt,t]{beamer} \documentclass[10pt,t]{beamer}
...@@ -61,18 +61,19 @@ ...@@ -61,18 +61,19 @@
\color{medgreen} \color{medgreen}
\item[4.10] Funktionen und Trigger \item[4.10] Funktionen und Trigger
\item[4.11] GUI-Zugriff \item[4.11] GUI-Zugriff
\color{orange}
\item[4.12] SQL Injection \item[4.12] SQL Injection
\color{red} \color{black}
\item[4.13] Datensicherheit bei Datenbanken \item[4.13] Datensicherheit bei Datenbanken
\item[4.14] Sonstige Datenbanken \item[4.14] Sonstige Datenbanken
\end{itemize} \end{itemize}
\item[\textbf{5}] \textbf{Kryptographie} \item[\textbf{5}] \textbf{Kryptographie}
\begin{itemize} % \begin{itemize}
\color{red} % \color{red}
\item[5.1] Einführung % \item[5.1] Einführung
\vspace*{-\smallskipamount} % \vspace*{-\smallskipamount}
\item[\textbf{\dots}] % \item[\textbf{\dots}]
\end{itemize} % \end{itemize}
\vspace*{-\smallskipamount} \vspace*{-\smallskipamount}
\item[\textbf{\dots}] \item[\textbf{\dots}]
\end{itemize} \end{itemize}
...@@ -183,14 +184,18 @@ ...@@ -183,14 +184,18 @@
Bessere Lösung: \newterm{Prepared Statements} Bessere Lösung: \newterm{Prepared Statements}
\begin{itemize} \begin{itemize}
\item \arrowitem
\url{https://www.postgresql.org/docs/current/sql-prepare.html} nächstes Jahr
\item % \item
\url{https://www.w3schools.com/php/php_mysql_prepared_statements.asp} % \url{https://www.postgresql.org/docs/current/sql-prepare.html}
% \item
% \url{https://www.w3schools.com/php/php_mysql_prepared_statements.asp}
\end{itemize} \end{itemize}
\end{frame} \end{frame}
\iffalse
\subsection{Datensicherheit bei Datenbanken} \subsection{Datensicherheit bei Datenbanken}
\begin{frame} \begin{frame}
...@@ -255,4 +260,6 @@ ...@@ -255,4 +260,6 @@
\end{frame} \end{frame}
\fi
\end{document} \end{document}
../common/Zeichen_123.pdf
\ No newline at end of file
File added
% dbs-20240111.pdf - Lecture Slides on Databases and Information Security
% Copyright (C) 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: Datensicherheit bei Datenbanken, sonstige Datenbanken, Kryptographie
\documentclass[10pt,t]{beamer}
\usepackage{pgslides}
\newcommand{\vfilll}{\vspace{0pt plus 1filll}}
\newcommand{\underconstruction}{%
\begin{picture}(0,0)
\put(11,1.2){\makebox(0,0)[b]{\includegraphics[width=1.5cm]{Zeichen_123.pdf}}}
\put(11,0.9){\makebox(0,0)[t]{\shortstack{Änderungen\\vorbehalten}}}
\end{picture}}
\title{Datenbanken und Datensicherheit}
\author{Prof.\ Dr.\ rer.\ nat.\ Peter Gerwinski}
\date{11.\ Januar 2024}
\begin{document}
\maketitleframe
\nosectionnonumber{\inserttitle}
\begin{frame}
\shownosectionnonumber
\begin{itemize}
\item[\textbf{1}] \textbf{Einführung}
\hfill\makebox(0,0)[br]{\raisebox{2.25ex}{\url{https://gitlab.cvh-server.de/pgerwinski/dbs}}}%
\item[\textbf{2}] \textbf{Kurzeinführung Unix}
\item[\textbf{3}] \textbf{Kurzeinführung TCP/IP}
\item[\textbf{4}] \textbf{Relationale Datenbanken}
\begin{itemize}
\vspace*{-\smallskipamount}
\item[\textbf{\dots}]
\item[4.9] Indizierung
\color{medgreen}
\item[4.10] Funktionen und Trigger
\item[4.11] GUI-Zugriff
\color{orange}
\item[4.12] SQL Injection
\color{red}
\item[4.13] Datensicherheit bei Datenbanken
\item[4.14] Sonstige Datenbanken
\end{itemize}
\item[\textbf{5}] \textbf{Kryptographie}
\begin{itemize}
\color{red}
\item[5.1] Einführung
\vspace*{-\smallskipamount}
\item[\textbf{\dots}]
\end{itemize}
\vspace*{-\smallskipamount}
\item[\textbf{\dots}]
\end{itemize}
\vfilll
\underconstruction
\end{frame}
\setcounter{section}{3}
\section{Relationale Datenbanken}
\setcounter{subsection}{9}
\subsection{Funktionen und Trigger}
\begin{frame}
\showsection
\showsubsection
Funktionen:
\begin{itemize}
\item
\lstinline[style=cmd]{PROCEDURE} entspricht einer \lstinline{void}-Funktion in C.
\item
\url{https://www.postgresql.org/docs/15/sql-createprocedure.html}
\end{itemize}
\bigskip
Trigger:
\begin{itemize}
\item
\url{https://www.sqltutorial.org/sql-triggers/}
\item
\url{https://www.postgresqltutorial.com/postgresql-triggers/creating-first-trigger-postgresql/}
\end{itemize}
\end{frame}
\subsection{GUI-Zugriff}
\begin{frame}
\showsection
\showsubsection
\begin{itemize}
\item
Anwendung nutzt DBMS-Client-Bibliothek\\
GUI-Programmierung: wie gewohnt
\item
Spezialfall: Web-Anwendung
\end{itemize}
\bigskip
Beispiel: Programmiersprache PHP
\begin{itemize}
\item
Integration in HTML-Quelltext: \lstinline{<?php ... ?>}
\item
Objekt zur Kommunikation mit Datenbanken: \lstinline{PDO}
\end{itemize}
\bigskip
Literatur:
\begin{itemize}
\item
\url{https://www.postgresqltutorial.com/postgresql-php/connect/}
\item
\url{https://www.phptutorial.net/php-pdo/pdo-connecting-to-postgresql/}
\end{itemize}
\end{frame}
\subsection{SQL Injection}
\begin{frame}[fragile]
\showsection
\showsubsection
Problem:
\begin{itemize}
\item
Ein böswilliger Benutzer gibt über eine Benutzerschnittstelle
(z.\,B.\ ein Web-Interface) Daten ein (z.\,B.\ einen "`Namen"'),
die Sonderzeichen enthalten, damit sie als SQL-Befehle ausgeführt werden.
\item
Literatur: \url{https://xkcd.com/327/}
\end{itemize}
\medskip
Lösung: Die Benutzerschnittstelle prüft die Daten auf Sonderzeichen\\
und ersetzt diese durch geeignete Escape-Sequenzen
\begin{itemize}
\item
\lstinline[style=cmd]{'} durch \lstinline[style=cmd]{''} ersetzen
\item
Funktion \lstinline[style=cmd]{CHR()}
\item
Viele DBMS verstehen ein vorangestelltes \lstinline[style=cmd]{\}.
\end{itemize}
\medskip
Bessere Lösung: \newterm{Prepared Statements}
\begin{itemize}
\item
\url{https://www.postgresql.org/docs/current/sql-prepare.html}
\item
\url{https://www.w3schools.com/php/php_mysql_prepared_statements.asp}
\end{itemize}
\end{frame}
\subsection{Datensicherheit bei Datenbanken}
\begin{frame}
\showsection
\showsubsection
\begin{itemize}
\item
kein direkter Zugriff von außen auf die Datenbank
\item
feingranulare Benutzerrechte
\item
Software aktuell halten
\item
Prepared Statements
\item
Transportverschlüsselung
\end{itemize}
\end{frame}
\subsection{Sonstige Datenbanken}
\begin{frame}
\showsection
\showsubsection
\begin{itemize}
\item
Eingebettete Datenbanken:\\
Berkeley DB, SQLite\\
Software-Bibliothek, keine Client-Server-Struktur
\item
Nicht-relationale Datenbanken:\\
dokumentenorientierte Datenbanken, noSQL\\
Performanz wichtiger als Konsistenz\\
\textarrow\ Applikationen stärker in Konsistenzprüfung eingebunden
\end{itemize}
\end{frame}
\section{Kryptographie}
\subsection{Einführung}
\begin{frame}
\showsection
\showsubsection
\textbf{Was ist Datensicherheit?}
\smallskip
\begin{minipage}[t]{0.24\textwidth}
\begin{itemize}
\item[] \strut
\item Vertraulichkeit
\item Integrität\\\strut
\item Verfügbarkeit
\end{itemize}
\end{minipage}%
\begin{minipage}[t]{0.25\textwidth}
\begin{itemize}
\item[] (CIA)
\item[] (confidentiality)
\item[] (integrity)\\\strut
\item[] (availability)
\end{itemize}
\end{minipage}\quad
\begin{minipage}[t]{0.45\textwidth}
\begin{itemize}
\item[] \strut
\arrowitem {\only<2->{\color{red}}Verschlüsselung}
\arrowitem Konsistenzprüfungen,\\
Prüfwerte, {\only<2->{\color{red}}Signaturen}
\arrowitem Backups, Ausfallsicherheit
\end{itemize}
\end{minipage}
\bigskip
\begin{itemize}
\item
Identifizierbarkeit
(Authentizität, Nichtabstreitbarkeit, Zurechenbarkeit)\\
\textarrow\ {\only<2->{\color{red}}Passwörter},
{\only<2->{\color{red}}Signaturen}\\[\smallskipamount]
bzw.
\item
Anonymität
(plausible Abstreitbarkeit, Nichtzurechenbarkeit)\\
\textarrow\ Pseudonymisierung, Anonymisierung,\\
\phantom{\textarrow\ }{\only<2->{\color{red}}Verschlüsselung}, Steganographie
\pause\hfill\textcolor{red}{\textarrow\ Kryptographie}
\end{itemize}
\end{frame}
\subsection{Symmetrische Verschlüsselung}
\begin{frame}
\showsection
\textbf{Kryptographie}
\begin{itemize}
\item
Verschlüsselung: symmetrisch, asymmetrisch, hybrid
\item
Hashes: Einwegfunktionen, Salt
\item
Signaturen, Zertifikate
\item
Schlüsselaustausch
\end{itemize}
\bigskip
\showsubsection
\vspace{-\medskipamount}
\begin{itemize}
\item
Derselbe Schlüssel zum Ver- und Entschlüsseln
\item
Beispiele:
{\only<6->{\color{red}}Cäsar-Chiffre},
{\only<6->{\color{red}}Monoalphabetische Substitution}\pause,\\
One Time Pad\visible<4->{,}\\
\visible<4->{%
\only<5->{\emph{spezielle }}Pseudozufallszahlengenerator\only<5->{en},
Startwert als Schlüssel\only<5->{:}\\
\visible<5->{
{\only<6->{\color{red}}Enigma},
{\only<6->{\color{red}}DES},
{\only<6->{\color{orange}}3DES},
{\only<6->{\color{orange}}RC4},
IDEA,
Blowfish,
TwoFish,
CAST,
AES,
\dots
}
}
\pause
\item
Problem: Schlüsselaustausch
\pause[7]
\item
Lösung: \newterm{asymmetrische Verschlüsselung}
\end{itemize}
\end{frame}
\subsection{Asymmetrische Verschlüsselung}
\begin{frame}
\showsubsection
\vspace{-\medskipamount}
\begin{itemize}
\item
verschiedene Schlüssel zum Ver- und Entschlüsseln:\\
öffentlicher und privater Schlüssel
\item
Prinzip: mathematische Operation,\\
einfach durchzuführen, schwer rückgängig zu machen
\medskip
\item
Beispiel: $N = p \cdot q$ -- einfacher als Primfaktorzerlegung von $N$
\textarrow\ RSA\\[\smallskipamount]
$73 \cdot 97 = 7081$: geht notfalls noch im Kopf\\
Primfaktorzerlegung von $7081$: mindestens schriftlich, besser mit Rechner
\medskip
\item
Beispiel: $c = b^a$ -- einfacher als $a = \log_b c$
\textarrow\ Diffie-Hellman, ElGamal\\[\smallskipamount]
$7^5 = 16807$: geht notfalls noch im Kopf\\
$\log_7 16807$: mindestens schriftlich, besser mit Rechner
\medskip
\arrowitem
Details: Algorithmen und Datenstrukturen
\pause
\bigskip
\item
Nachteil: wesentlich aufwendiger und daher langsamer\\
als symmetrische Verschlüsselung
\arrowitem
\newterm{hybride Verschlüsselung}: nur Schlüsselaustausch asymmetrisch,\\
eigentliche Vrschlüsselung symmetrisch
\end{itemize}
\end{frame}
\subsection{Signaturen}
\begin{frame}
\showsubsection
\vspace{-\medskipamount}
\begin{itemize}
\item
\newterm{kryptographische Hash-Funktion\/}:
leicht auszurechnen, schwer zu manipulieren
\item
asymmetrisch: \newterm{Signatur}\\
Hash-Wert mit privatem Schlüssel verschlüsseln,\\
mit öffentlichem Schlüssel entschlüsseln
\item
symmetrisch: \newterm{Message Authentication Code\/} (MAC)\\
z.\,B.\ Hash-Wert über Nachricht + geheimer Schlüssel
\end{itemize}
\pause
\bigskip
Angriffsmöglichkeit: \newterm{Man-in-the-middle\/}-Angriff\\
Beim Schlüsselaustausch anderen Schlüssel unterschieben\\
\textarrow\ Sorgfalt beim Schlüsselaustausch
\pause
\bigskip
\textbf{Praxis-Beispiele}
\begin{itemize}
\item
SSH
\item
HTTPS
\item
OpenPGP
\end{itemize}
\end{frame}
\end{document}
../common/logo-hochschule-bochum-cvh-text-v2.pdf
\ No newline at end of file
../common/logo-hochschule-bochum.pdf
\ No newline at end of file
../common/pgslides.sty
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment