<mxfile host="app.diagrams.net" modified="2026-02-14T12:00:00.000Z" agent="Claude Code" version="21.0.0" type="device">
  <diagram id="secnote-flow" name="SecNote Ablaufdiagramm">
    <mxGraphModel dx="1800" dy="2400" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="0" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
      <root>
        <mxCell id="0"/>
        <mxCell id="1" parent="0"/>

        <!-- ============================================================ -->
        <!-- TITEL -->
        <!-- ============================================================ -->
        <mxCell id="title" value="SecNote - Ablaufdiagramm (V2.2)" style="text;html=1;fontSize=24;fontStyle=1;align=center;verticalAlign=middle;whiteSpace=wrap;fillColor=none;strokeColor=none;fontColor=#333333;" vertex="1" parent="1">
          <mxGeometry x="250" y="-80" width="700" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="subtitle" value="Clientseitige AES-256-GCM Verschlüsselung mit einmaligem Lesen" style="text;html=1;fontSize=13;fontStyle=2;align=center;verticalAlign=middle;whiteSpace=wrap;fillColor=none;strokeColor=none;fontColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="300" y="-40" width="600" height="30" as="geometry"/>
        </mxCell>

        <!-- ============================================================ -->
        <!-- LEGENDE -->
        <!-- ============================================================ -->
        <mxCell id="legend_box" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#CCCCCC;dashed=1;" vertex="1" parent="1">
          <mxGeometry x="950" y="0" width="220" height="200" as="geometry"/>
        </mxCell>
        <mxCell id="legend_title" value="&lt;b&gt;Legende&lt;/b&gt;" style="text;html=1;fontSize=12;align=center;verticalAlign=middle;fillColor=none;strokeColor=none;" vertex="1" parent="1">
          <mxGeometry x="950" y="5" width="220" height="25" as="geometry"/>
        </mxCell>
        <mxCell id="leg1" value="" style="rounded=1;whiteSpace=wrap;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="965" y="35" width="30" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="leg1t" value="Client / Browser" style="text;html=1;fontSize=10;align=left;fillColor=none;strokeColor=none;" vertex="1" parent="1">
          <mxGeometry x="1000" y="35" width="150" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="leg2" value="" style="rounded=1;whiteSpace=wrap;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
          <mxGeometry x="965" y="60" width="30" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="leg2t" value="Server / PHP" style="text;html=1;fontSize=10;align=left;fillColor=none;strokeColor=none;" vertex="1" parent="1">
          <mxGeometry x="1000" y="60" width="150" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="leg3" value="" style="rounded=1;whiteSpace=wrap;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
          <mxGeometry x="965" y="85" width="30" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="leg3t" value="Kryptographie" style="text;html=1;fontSize=10;align=left;fillColor=none;strokeColor=none;" vertex="1" parent="1">
          <mxGeometry x="1000" y="85" width="150" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="leg4" value="" style="rounded=1;whiteSpace=wrap;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
          <mxGeometry x="965" y="110" width="30" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="leg4t" value="Fehler / Löschen" style="text;html=1;fontSize=10;align=left;fillColor=none;strokeColor=none;" vertex="1" parent="1">
          <mxGeometry x="1000" y="110" width="150" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="leg5" value="" style="shape=cylinder3;whiteSpace=wrap;fillColor=#e1d5e7;strokeColor=#9673a6;size=8;" vertex="1" parent="1">
          <mxGeometry x="965" y="135" width="30" height="25" as="geometry"/>
        </mxCell>
        <mxCell id="leg5t" value="Datenbank" style="text;html=1;fontSize=10;align=left;fillColor=none;strokeColor=none;" vertex="1" parent="1">
          <mxGeometry x="1000" y="140" width="150" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="leg6" value="" style="rhombus;whiteSpace=wrap;fillColor=#FFFFFF;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="965" y="165" width="30" height="25" as="geometry"/>
        </mxCell>
        <mxCell id="leg6t" value="Entscheidung" style="text;html=1;fontSize=10;align=left;fillColor=none;strokeColor=none;" vertex="1" parent="1">
          <mxGeometry x="1000" y="168" width="150" height="20" as="geometry"/>
        </mxCell>

        <!-- ============================================================ -->
        <!-- SWIMLANE: CREATE-FLOW (links) -->
        <!-- ============================================================ -->
        <mxCell id="swim_create" value="&lt;b&gt;CREATE-FLOW&lt;/b&gt;&lt;br&gt;(Absender erstellt Nachricht)" style="shape=table;startSize=40;container=1;collapsible=0;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=0;align=center;resizeLast=0;fillColor=#E6E6E6;strokeColor=#999999;rounded=1;arcSize=5;fontSize=13;" vertex="1" parent="1">
          <mxGeometry x="0" y="0" width="520" height="1210" as="geometry"/>
        </mxCell>

        <!-- CREATE: Start -->
        <mxCell id="c_start" value="" style="ellipse;fillColor=#333333;strokeColor=#333333;" vertex="1" parent="1">
          <mxGeometry x="240" y="60" width="40" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="c_start_label" value="Benutzer öffnet&lt;br&gt;secnote.eblok.de" style="text;html=1;fontSize=10;align=center;fillColor=none;strokeColor=none;fontColor=#333333;" vertex="1" parent="1">
          <mxGeometry x="195" y="100" width="130" height="30" as="geometry"/>
        </mxCell>

        <!-- CREATE: Formular -->
        <mxCell id="c_form" value="&lt;b&gt;Eingabeformular&lt;/b&gt;&lt;br&gt;anzeigen&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;(Textarea, opt. Bild, opt. Passwort)&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="170" y="145" width="180" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="c_start_to_form" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_start" target="c_form" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Eingabe -->
        <mxCell id="c_input" value="Benutzer gibt &lt;b&gt;Text&lt;/b&gt; ein&lt;br&gt;(optional: Bild, Passwort)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="170" y="230" width="180" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="c_form_to_input" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_form" target="c_input" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Submit -->
        <mxCell id="c_submit" value="Klick auf&lt;br&gt;&lt;b&gt;&quot;Link erstellen&quot;&lt;/b&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="185" y="305" width="150" height="45" as="geometry"/>
        </mxCell>
        <mxCell id="c_input_to_submit" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_input" target="c_submit" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Validierung -->
        <mxCell id="c_valid" value="Text oder Bild&lt;br&gt;vorhanden?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="205" y="375" width="110" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="c_submit_to_valid" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_submit" target="c_valid" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Validierung NEIN -->
        <mxCell id="c_valid_no" value="&lt;font color=&quot;#cc0000&quot;&gt;Fehlermeldung:&lt;br&gt;&quot;Bitte Text eingeben&lt;br&gt;oder Bild anhängen&quot;&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
          <mxGeometry x="360" y="385" width="150" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="c_valid_to_no" value="Nein" style="edgeStyle=orthogonalEdgeStyle;fontStyle=1;fontColor=#cc0000;" edge="1" source="c_valid" target="c_valid_no" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Key generieren -->
        <mxCell id="c_genkey" value="&lt;b&gt;AES-256-Schlüssel&lt;/b&gt;&lt;br&gt;generieren&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;(32 Bytes, kryptographisch sicher)&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
          <mxGeometry x="170" y="485" width="180" height="55" as="geometry"/>
        </mxCell>
        <mxCell id="c_valid_to_genkey" value="Ja" style="edgeStyle=orthogonalEdgeStyle;fontStyle=1;fontColor=#009900;" edge="1" source="c_valid" target="c_genkey" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Passwort? -->
        <mxCell id="c_pw_check" value="Passwort&lt;br&gt;gesetzt?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="205" y="565" width="110" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="c_genkey_to_pw" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_genkey" target="c_pw_check" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Einfache Verschlüsselung -->
        <mxCell id="c_enc_simple" value="&lt;b&gt;AES-256-GCM&lt;/b&gt;&lt;br&gt;Verschlüsselung&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;IV(12) + Ciphertext + Tag(16)&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
          <mxGeometry x="45" y="575" width="140" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="c_pw_to_simple" value="Nein" style="edgeStyle=orthogonalEdgeStyle;fontColor=#666666;" edge="1" source="c_pw_check" target="c_enc_simple" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Doppelte Verschlüsselung -->
        <mxCell id="c_enc_double" value="&lt;b&gt;Doppelte Verschlüsselung&lt;/b&gt;&lt;br&gt;1. AES-GCM (Schlüssel)&lt;br&gt;2. PBKDF2 + AES-GCM (PW)&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;Salt(16) + IV(12) + Cipher + Tag(16)&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
          <mxGeometry x="335" y="565" width="175" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="c_pw_to_double" value="Ja" style="edgeStyle=orthogonalEdgeStyle;fontColor=#666666;" edge="1" source="c_pw_check" target="c_enc_double" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Base64 -->
        <mxCell id="c_base64" value="Ergebnis &lt;b&gt;Base64&lt;/b&gt;-kodieren&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;(für Datenübertragung an Server)&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="170" y="680" width="180" height="45" as="geometry"/>
        </mxCell>
        <mxCell id="c_simple_to_b64" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_enc_simple" target="c_base64" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="c_double_to_b64" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_enc_double" target="c_base64" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: AJAX POST -->
        <mxCell id="c_ajax" value="&lt;b&gt;AJAX POST&lt;/b&gt; an Server&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;api_create + CSRF-Token&lt;br&gt;(msg, img, passwort, fehler)&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="170" y="750" width="180" height="55" as="geometry"/>
        </mxCell>
        <mxCell id="c_b64_to_ajax" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_base64" target="c_ajax" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Server speichert -->
        <mxCell id="c_server" value="Server: &lt;b&gt;Code generieren&lt;/b&gt;&lt;br&gt;(8 Zeichen alphanumerisch)&lt;br&gt;&lt;b&gt;In DB speichern&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;Counter aktualisieren&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
          <mxGeometry x="165" y="830" width="190" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="c_ajax_to_server" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_ajax" target="c_server" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: DB -->
        <mxCell id="c_db" value="&lt;b&gt;nachrichten&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;rid | msg | datum&lt;br&gt;passwort | fehler | img&lt;/font&gt;" style="shape=cylinder3;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;size=10;" vertex="1" parent="1">
          <mxGeometry x="380" y="830" width="130" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="c_server_to_db" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_server" target="c_db" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: URL bauen -->
        <mxCell id="c_url" value="&lt;b&gt;URL zusammensetzen&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;secnote.eblok.de/index.php?id=&lt;b&gt;CODE&lt;/b&gt;&lt;b style=&quot;color:#cc0000&quot;&gt;#SCHLÜSSEL&lt;/b&gt;&lt;br&gt;&lt;br&gt;⚠ Fragment (#) wird NICHT&lt;br&gt;an den Server gesendet!&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
          <mxGeometry x="155" y="930" width="210" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="c_server_to_url" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_server" target="c_url" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Link anzeigen -->
        <mxCell id="c_show" value="&lt;b&gt;Link anzeigen&lt;/b&gt;&lt;br&gt;+ Kopier-Button&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;(Clipboard.js)&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="185" y="1040" width="150" height="55" as="geometry"/>
        </mxCell>
        <mxCell id="c_url_to_show" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_url" target="c_show" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: Ende -->
        <mxCell id="c_send" value="Absender teilt Link&lt;br&gt;per Messenger / E-Mail" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;dashed=1;" vertex="1" parent="1">
          <mxGeometry x="180" y="1120" width="160" height="45" as="geometry"/>
        </mxCell>
        <mxCell id="c_show_to_send" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_show" target="c_send" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- CREATE: End-Kreis -->
        <mxCell id="c_end" value="" style="ellipse;fillColor=#333333;strokeColor=#333333;" vertex="1" parent="1">
          <mxGeometry x="245" y="1185" width="30" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="c_send_to_end" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="c_send" target="c_end" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- ============================================================ -->
        <!-- VERBINDUNGSPFEIL: CREATE -> VIEW -->
        <!-- ============================================================ -->
        <mxCell id="transfer_arrow" value="&lt;b&gt;Link wird geteilt&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;(Messenger, E-Mail, etc.)&lt;/font&gt;" style="shape=flexArrow;endArrow=classic;html=1;fillColor=#E6E6E6;strokeColor=#999999;width=20;endSize=8;fontSize=11;" edge="1" parent="1">
          <mxGeometry x="0.1" y="10" relative="1" as="geometry">
            <mxPoint x="520" y="600" as="sourcePoint"/>
            <mxPoint x="620" y="600" as="targetPoint"/>
            <mxPoint as="offset"/>
          </mxGeometry>
        </mxCell>

        <!-- ============================================================ -->
        <!-- SWIMLANE: VIEW-FLOW (rechts) -->
        <!-- ============================================================ -->
        <mxCell id="swim_view" value="&lt;b&gt;VIEW-FLOW&lt;/b&gt;&lt;br&gt;(Empfänger liest Nachricht)" style="shape=table;startSize=40;container=1;collapsible=0;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=0;align=center;resizeLast=0;fillColor=#E6E6E6;strokeColor=#999999;rounded=1;arcSize=5;fontSize=13;" vertex="1" parent="1">
          <mxGeometry x="620" y="0" width="520" height="1210" as="geometry"/>
        </mxCell>

        <!-- VIEW: Start -->
        <mxCell id="v_start" value="" style="ellipse;fillColor=#333333;strokeColor=#333333;" vertex="1" parent="1">
          <mxGeometry x="860" y="60" width="40" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="v_start_label" value="Empfänger öffnet Link&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;?id=CODE#SCHLÜSSEL&lt;/font&gt;" style="text;html=1;fontSize=10;align=center;fillColor=none;strokeColor=none;fontColor=#333333;" vertex="1" parent="1">
          <mxGeometry x="810" y="100" width="140" height="30" as="geometry"/>
        </mxCell>

        <!-- VIEW: Schlüssel prüfen -->
        <mxCell id="v_hash" value="Schlüssel (#)&lt;br&gt;in URL?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="825" y="145" width="110" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="v_start_to_hash" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="v_start" target="v_hash" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Kein Schlüssel -->
        <mxCell id="v_no_hash" value="&lt;font color=&quot;#cc0000&quot;&gt;&quot;Der Schlüssel&lt;br&gt;fehlt in der URL&quot;&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
          <mxGeometry x="990" y="155" width="140" height="50" as="geometry"/>
        </mxCell>
        <mxCell id="v_hash_to_no" value="Nein" style="edgeStyle=orthogonalEdgeStyle;fontStyle=1;fontColor=#cc0000;" edge="1" source="v_hash" target="v_no_hash" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: API Fetch -->
        <mxCell id="v_fetch" value="&lt;b&gt;API-Fetch&lt;/b&gt;: Verschlüsselte&lt;br&gt;Daten vom Server laden&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;GET api_fetch&amp;id=CODE&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;" vertex="1" parent="1">
          <mxGeometry x="800" y="260" width="160" height="55" as="geometry"/>
        </mxCell>
        <mxCell id="v_hash_to_fetch" value="Ja" style="edgeStyle=orthogonalEdgeStyle;fontStyle=1;fontColor=#009900;" edge="1" source="v_hash" target="v_fetch" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: DB Lesen -->
        <mxCell id="v_db" value="&lt;b&gt;nachrichten&lt;/b&gt;" style="shape=cylinder3;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;size=10;" vertex="1" parent="1">
          <mxGeometry x="1000" y="267" width="100" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="v_fetch_to_db" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="v_fetch" target="v_db" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Nachricht gefunden? -->
        <mxCell id="v_found" value="Nachricht&lt;br&gt;gefunden?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="825" y="345" width="110" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="v_fetch_to_found" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="v_fetch" target="v_found" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Nicht gefunden -->
        <mxCell id="v_not_found" value="&lt;font color=&quot;#cc0000&quot;&gt;&quot;Keine ungelesene&lt;br&gt;Nachricht mehr&quot;&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
          <mxGeometry x="990" y="360" width="140" height="45" as="geometry"/>
        </mxCell>
        <mxCell id="v_found_to_no" value="Nein" style="edgeStyle=orthogonalEdgeStyle;fontStyle=1;fontColor=#cc0000;" edge="1" source="v_found" target="v_not_found" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Passwort? -->
        <mxCell id="v_pw" value="Passwort-&lt;br&gt;geschützt?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="825" y="460" width="110" height="80" as="geometry"/>
        </mxCell>
        <mxCell id="v_found_to_pw" value="Ja" style="edgeStyle=orthogonalEdgeStyle;fontStyle=1;fontColor=#009900;" edge="1" source="v_found" target="v_pw" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Passwort Eingabe -->
        <mxCell id="v_pw_form" value="&lt;b&gt;Passwort-Formular&lt;/b&gt;&lt;br&gt;anzeigen&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;+ verbleibende Versuche&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="980" y="470" width="150" height="55" as="geometry"/>
        </mxCell>
        <mxCell id="v_pw_to_form" value="Ja" style="edgeStyle=orthogonalEdgeStyle;fontColor=#666666;" edge="1" source="v_pw" target="v_pw_form" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: PW Eingabe -->
        <mxCell id="v_pw_input" value="Empfänger gibt&lt;br&gt;&lt;b&gt;Passwort&lt;/b&gt; ein" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="990" y="555" width="130" height="45" as="geometry"/>
        </mxCell>
        <mxCell id="v_form_to_input" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="v_pw_form" target="v_pw_input" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Entschlüsselung -->
        <mxCell id="v_decrypt" value="&lt;b&gt;Entschlüsselung&lt;/b&gt;&lt;br&gt;(clientseitig im Browser)&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;AES-256-GCM via forge&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
          <mxGeometry x="790" y="640" width="180" height="55" as="geometry"/>
        </mxCell>
        <mxCell id="v_pw_to_decrypt" value="Nein" style="edgeStyle=orthogonalEdgeStyle;fontColor=#666666;" edge="1" source="v_pw" target="v_decrypt" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>
        <mxCell id="v_input_to_decrypt" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="v_pw_input" target="v_decrypt" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Entschlüsselung OK? -->
        <mxCell id="v_dec_ok" value="Erfolgreich?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="835" y="725" width="90" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="v_decrypt_to_ok" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="v_decrypt" target="v_dec_ok" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: PW Falsch -->
        <mxCell id="v_pw_wrong" value="&lt;b&gt;Fehlversuch melden&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;POST api_attempt&lt;br&gt;fehler = fehler - 1&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
          <mxGeometry x="990" y="670" width="140" height="55" as="geometry"/>
        </mxCell>
        <mxCell id="v_ok_to_wrong" value="Nein" style="edgeStyle=orthogonalEdgeStyle;fontStyle=1;fontColor=#cc0000;" edge="1" source="v_dec_ok" target="v_pw_wrong" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Versuche übrig? -->
        <mxCell id="v_attempts" value="Versuche&lt;br&gt;übrig?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="1005" y="750" width="110" height="70" as="geometry"/>
        </mxCell>
        <mxCell id="v_wrong_to_attempts" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="v_pw_wrong" target="v_attempts" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Zurück zum PW-Formular -->
        <mxCell id="v_retry_label" value="Erneut&lt;br&gt;versuchen" style="text;html=1;fontSize=9;align=center;fillColor=none;strokeColor=none;fontColor=#009900;" vertex="1" parent="1">
          <mxGeometry x="1100" y="540" width="60" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="v_attempts_to_form" value="Ja" style="edgeStyle=orthogonalEdgeStyle;fontColor=#009900;curved=1;" edge="1" source="v_attempts" target="v_pw_form" parent="1">
          <mxGeometry relative="1" as="geometry">
            <Array as="points">
              <mxPoint x="1130" y="785"/>
              <mxPoint x="1130" y="497"/>
            </Array>
          </mxGeometry>
        </mxCell>

        <!-- VIEW: Nachricht löschen (max Versuche) -->
        <mxCell id="v_delete_pw" value="&lt;font color=&quot;#cc0000&quot;&gt;&lt;b&gt;Nachricht löschen&lt;/b&gt;&lt;br&gt;&quot;Passwort falsch,&lt;br&gt;Nachricht gelöscht&quot;&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
          <mxGeometry x="990" y="850" width="150" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="v_attempts_to_delete" value="Nein" style="edgeStyle=orthogonalEdgeStyle;fontStyle=1;fontColor=#cc0000;" edge="1" source="v_attempts" target="v_delete_pw" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Nachricht anzeigen -->
        <mxCell id="v_show" value="&lt;b&gt;Nachricht anzeigen&lt;/b&gt;&lt;br&gt;Text + Bild (entschlüsselt)&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;XSS-escaped via escapeHtml()&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="790" y="840" width="180" height="55" as="geometry"/>
        </mxCell>
        <mxCell id="v_ok_to_show" value="Ja" style="edgeStyle=orthogonalEdgeStyle;fontStyle=1;fontColor=#009900;" edge="1" source="v_dec_ok" target="v_show" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Löschen -->
        <mxCell id="v_delete" value="&lt;b&gt;Nachricht vom Server löschen&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;POST api_delete + CSRF-Token&lt;br&gt;DELETE FROM nachrichten WHERE rid=?&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;" vertex="1" parent="1">
          <mxGeometry x="770" y="930" width="220" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="v_show_to_delete" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="v_show" target="v_delete" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Bestätigung -->
        <mxCell id="v_confirm" value="&lt;b&gt;&quot;Die Nachricht&lt;br&gt;wurde gelöscht&quot;&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;+ Link zu &quot;Selbst eine Nachricht erstellen&quot;&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
          <mxGeometry x="800" y="1020" width="160" height="65" as="geometry"/>
        </mxCell>
        <mxCell id="v_delete_to_confirm" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="v_delete" target="v_confirm" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- VIEW: Ende -->
        <mxCell id="v_end" value="" style="ellipse;fillColor=#333333;strokeColor=#333333;" vertex="1" parent="1">
          <mxGeometry x="865" y="1115" width="30" height="30" as="geometry"/>
        </mxCell>
        <mxCell id="v_confirm_to_end" style="edgeStyle=orthogonalEdgeStyle;" edge="1" source="v_confirm" target="v_end" parent="1">
          <mxGeometry relative="1" as="geometry"/>
        </mxCell>

        <!-- ============================================================ -->
        <!-- AUTO-CLEANUP (unten) -->
        <!-- ============================================================ -->
        <mxCell id="cleanup_box" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#999999;dashed=1;" vertex="1" parent="1">
          <mxGeometry x="250" y="1260" width="700" height="100" as="geometry"/>
        </mxCell>
        <mxCell id="cleanup_title" value="&lt;b&gt;AUTO-BEREINIGUNG&lt;/b&gt; (bei jedem Seitenaufruf)" style="text;html=1;fontSize=12;align=center;fillColor=none;strokeColor=none;" vertex="1" parent="1">
          <mxGeometry x="400" y="1265" width="400" height="25" as="geometry"/>
        </mxCell>
        <mxCell id="cleanup1" value="Alle Nachrichten&lt;br&gt;laden" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=10;" vertex="1" parent="1">
          <mxGeometry x="270" y="1300" width="110" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="cleanup_arrow1" value="" style="endArrow=classic;html=1;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="380" y="1320" as="sourcePoint"/>
            <mxPoint x="420" y="1320" as="targetPoint"/>
          </mxGeometry>
        </mxCell>
        <mxCell id="cleanup2" value="datum &lt;&lt;br&gt;(jetzt - 3 Tage)?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#FFFFFF;strokeColor=#666666;fontSize=10;" vertex="1" parent="1">
          <mxGeometry x="420" y="1293" width="120" height="60" as="geometry"/>
        </mxCell>
        <mxCell id="cleanup_arrow2" value="" style="endArrow=classic;html=1;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="540" y="1320" as="sourcePoint"/>
            <mxPoint x="580" y="1320" as="targetPoint"/>
          </mxGeometry>
        </mxCell>
        <mxCell id="cleanup3" value="Ja: &lt;b&gt;DELETE&lt;/b&gt;&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;Nachricht löschen&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=10;" vertex="1" parent="1">
          <mxGeometry x="580" y="1300" width="120" height="40" as="geometry"/>
        </mxCell>
        <mxCell id="cleanup_arrow3" value="" style="endArrow=classic;html=1;" edge="1" parent="1">
          <mxGeometry relative="1" as="geometry">
            <mxPoint x="700" y="1320" as="sourcePoint"/>
            <mxPoint x="740" y="1320" as="targetPoint"/>
          </mxGeometry>
        </mxCell>
        <mxCell id="cleanup4" value="Nein:&lt;br&gt;&lt;font style=&quot;font-size:9px&quot;&gt;Behalten&lt;/font&gt;" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=10;" vertex="1" parent="1">
          <mxGeometry x="740" y="1300" width="90" height="40" as="geometry"/>
        </mxCell>

        <!-- ============================================================ -->
        <!-- SICHERHEITSHINWEIS -->
        <!-- ============================================================ -->
        <mxCell id="security_box" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#FFF9E6;strokeColor=#d6b656;dashed=1;" vertex="1" parent="1">
          <mxGeometry x="250" y="1385" width="700" height="90" as="geometry"/>
        </mxCell>
        <mxCell id="security_title" value="&lt;b&gt;🔒 SICHERHEITSKONZEPT&lt;/b&gt;" style="text;html=1;fontSize=12;align=center;fillColor=none;strokeColor=none;" vertex="1" parent="1">
          <mxGeometry x="400" y="1390" width="400" height="20" as="geometry"/>
        </mxCell>
        <mxCell id="security_text" value="• Der &lt;b&gt;Verschlüsselungsschlüssel&lt;/b&gt; ist nur im URL-Fragment (#) → wird &lt;b&gt;NICHT&lt;/b&gt; an den Server gesendet&lt;br&gt;• Der Server speichert nur &lt;b&gt;verschlüsselte Daten&lt;/b&gt; → kann Nachrichten nicht lesen&lt;br&gt;• Jede Nachricht wird nach dem &lt;b&gt;einmaligen Lesen gelöscht&lt;/b&gt; (Read-Once-Prinzip)&lt;br&gt;• &lt;b&gt;CSRF-Token&lt;/b&gt; schützt alle schreibenden API-Endpunkte • &lt;b&gt;CSP-Header&lt;/b&gt; gegen XSS" style="text;html=1;fontSize=10;align=left;fillColor=none;strokeColor=none;spacingLeft=10;" vertex="1" parent="1">
          <mxGeometry x="270" y="1410" width="660" height="60" as="geometry"/>
        </mxCell>

      </root>
    </mxGraphModel>
  </diagram>
</mxfile>
