Giter VIP home page Giter VIP logo

diffie-hellman-export-grade-attack's Introduction

Diffie-Hellman export grade attack

The Diffie-Hellman export grade attack refers to a security vulnerability associated with the use of weak key lengths in the Diffie-Hellman key exchange protocol. This vulnerability primarily affected systems that implemented export-grade cryptography during the 1990s, as mandated by the U.S. government's export regulations on cryptographic software and hardware.

During that time, the U.S. government imposed restrictions on the export of strong cryptographic algorithms, considering them as munitions. As a result, many products were limited to using key lengths of 512 bits or less for encryption, which was significantly weaker than the standard key lengths used for secure communications.

The Diffie-Hellman key exchange allows two parties to establish a shared secret key over an insecure communication channel. However, when implemented with weak key lengths, it became susceptible to attacks. The limited key length made it easier for attackers to perform brute-force attacks, where they could potentially try all possible key combinations within a feasible amount of time.

In 2015, the Logjam attack highlighted the risks associated with export-grade cryptography, including Diffie-Hellman key exchange. Logjam exploited the fact that many servers and clients were still supporting weak, export-grade Diffie-Hellman parameters. The attackers could perform precomputation and build a large database of potential keys, making it easier to break the encryption.

To mitigate the risks associated with the Diffie-Hellman export grade attack, it is crucial to use strong key lengths and avoid the use of export-grade cryptographic algorithms. System administrators and developers should ensure that their systems are configured with secure cryptographic parameters to protect against potential attacks. In recent years, there have been efforts to deprecate and eliminate support for export-grade cryptography in various protocols and applications.

About

The following program is created for a CTF crypto challenge in CryptoHack associated with the DH export-grade attack. It automatically performs a man-in-the-middle attack, where an unauthorized entity intercepts and alters the communication between two parties (Bob and Alice). As a result, it is capable of downgrading the encryption and solving the discrete log problem, ultimately obtaining the flag.

Installation

Use the package manager pip to install the required packages.

pip3 install pwntools pycryptodome

Also Sagemath is required for solving the discrete log problem.

Usage

python3 export-grade.py

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is under Apache 2.0 licence.

diffie-hellman-export-grade-attack's People

Contributors

pnasis avatar

Stargazers

Apostolos Papasikas avatar Giannis Tsardas avatar Phoebus Petsimeris avatar  avatar Savvas Misailidis avatar Thanasis Emmanouilidis avatar

Watchers

 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.