GithubHelp home page GithubHelp logo

aufgabe-6-lineare-kryptoanalyse's Introduction

Lineare Kryptoanalyse nach Matsui
Implementierung in Java

0 Start

Kompilieren und ausführen:

  javac LineareKryptoanalyse.java
  java LineareKryptoanalyse

1 Allgemein

Ziel des Programms ist die Lineare Kryptoanalyse einer DES Verschlüsselung in 4 Runden mit Schlüssellänge 64 Bit.

Die Implementierung fundiert auf dem Paper von Howard M. Heys "A Tutorial on Linear and Differential Cryptanalysis", welches hier zu finden ist: https://www.engr.mun.ca/~howard/PAPERS/ldc_tutorial.pdf sowie auf der Vorlesung von Prof. Dr. Geser. Der Code selbst ist zum Teil inspiriert von der C Implementierung von Jon King, hier zu finden: http://www.theamazingking.com/crypto-linear.php
Das Programm hat keinen Input, d.h. es kann nicht als Angriff auf fremde Verschlüsselungen verwendet werden.
Stattdessen werden zufällige plaintext/ciphertext Paare generiert.
Das Projekt ist im Rahmen der Vorlesung Kryptologie an der HTWK Leipzig im WS 2016/17 entstanden.
Umgesetzt von Simeon Ackermann & Tim Menapace.

2 Anwendung

Als User reicht es die main.java Funktion zu kompilieren und auszuführen.
Die main Funktion ruft die crypt class auf und dort passiert alles weitere.

3 Funktionsweise

Initialisierung:
S-Box, Inverse S-Box & Transpositions Tablle initialisieren
Diverse Variablen deklarieren

//fillKnowns()
5 Rundenschlüssel mit jeweils 16-Bit Länge generieren
2^16 Klartexte mit jeweils 16-Bit Länge generieren
Plaintext in 4 Runden verschlüsseln
-> 2^16 Known plaintext Paare

//findApprox(), applyMask(), showApprox()
Approximationstabelle für 4 Bit Input & 4 Bit Output generieren

//findPartKeys()
Wähle Gleichungen nach Matsuis Algorithmus mit hoher Abweichung
Hier nicht dynamisch implementiert, sondern
Runde 1: Input: 11, Output: 4
Runde 2: Input: 4, Output: 5
Runde 3: Input: 4, Output: 5
Runde 4: Input: 4, Output: 5
Abweichung jeweils 1/4. Kumuliert mit Piling-Up Lemma 1/32

Finale Gleichung mit allen Known-plaintext Paaren testen.

//showPartTable(), getIndexOfHighestValue()
Ergebnis in Tabelle festhalten und Wert mit höchster Abweichung von 1/2 entspricht gesuchtem Schlüsselbit

Ausgabe der Schlüsselbits 5-8 & 13-16 des Teilschlüssels der 5.Runde in Hexadezimalzahlen

4 Konfigurationsdetails

Die Verschlüsselung kann in folgenden Punkten leicht angepasst werden:

  • Substitution (S-Box) //int[] sBox
  • Transposition //int[] transTable
  • Anzahl der Known-Plaintext Paare //int numKnown
  • Anzahl der Runden // int numRounds

5 Performancebetrachtung

Die Laufzeit des Algorithmus ist abhängig von der Anzahl der generierten Plaintext-Paare (standard = 2^16)
Obwohl keine theorethische bzw. praktische Laufzeitanalyse gemacht wurde, wird vermutet dass der Algorithmus in Java niemals seine volle Performance erreichen kann. Auf Grund der umständlichen Behandlung von Binärzahlen in Java bleibt stets ein Overhead bestehen.

aufgabe-6-lineare-kryptoanalyse's People

Contributors

egodigitus avatar simeonackermann avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.