Comparative Analysis and Optimization of MD5 and MD6 Hashing Algorithm Implementations in C++, OpenCL, and Verilog

Overview

This project explores the performance and efficiency of MD5 and MD6 hashing algorithm implementations across different programming languages: C++, OpenCL, and Verilog. The focus is on evaluating execution time and comparing performance to identify the best implementation strategy.

Objectives

  • Implement MD5 and MD6 hashing algorithms in C++, OpenCL, and Verilog.
  • Evaluate execution time and throughput across implementations.
  • Analyze the trade-offs between software and hardware implementations.

Technologies Used

  • C++
  • OpenCL
  • Verilog
  • Xilinx Vivado Design Suite
  • JetBrains CLion 2024 IDE

Details

The project involves implementing the MD5 and MD6 hashing algorithms in different environments to compare their performance. The MD5 algorithm, being inherently sequential, presents challenges for parallelization. However, the MD6 algorithm, designed with parallelization in mind, is evaluated for its efficiency on multicore processors and parallel computing platforms.

The implementations include a sequential MD5 in C++, an OpenCL MD5 to test parallel capabilities, and a Verilog MD5 for hardware acceleration. The MD6 algorithm is implemented sequentially and in parallel using C++ to demonstrate the benefits of parallel processing.

Challenges

One of the primary challenges faced was the sequential nature of the MD5 algorithm, which limited its potential for parallelization. Implementing MD5 in OpenCL highlighted performance bottlenecks, particularly in kernel execution and data transfer. Additionally, the Verilog implementation was constrained by the maximum input size it could handle, limiting its practical applicability.

Results

The project successfully demonstrated the performance differences across various implementations. The parallelized C++ MD6 implementation achieved significant speedup, making it the most efficient for handling large data volumes. The Verilog MD5 implementation, though extremely fast for small inputs, was limited by its maximum input size constraint. The OpenCL MD5 implementation faced performance issues, highlighting the need for further optimization.

Execution Time Graph

Figure 2a: Comparison of Execution Time Across Implementations

Throughput Graph

Figure 2b: Comparison of Throughput Across Implementations

View the Full Report

You can view the full project report here: Comparative Analysis and Optimization of MD5 and MD6 Hashing Algorithm Implementations in C++, OpenCL, and Verilog.