import matplotlib.pyplot as plt # Average times (in seconds) for each algorithm and file size file_sizes = ["100 kB", "1 MB", "10 MB", "100 MB"] md5_times = [0.01592, 0.01958, 0.05375, 0.35517] sha1_times = [0.02275, 0.01992, 0.05183, 0.34858] ripemd160_times = [0.01808, 0.02317, 0.08158, 0.61450] sha256_times = [0.01775, 0.02483, 0.10167, 0.53550] sha512_times = [0.04625, 0.02167, 0.08858, 0.45167] plt.figure() plt.plot(file_sizes, md5_times, marker='o', label='MD5') plt.plot(file_sizes, sha1_times, marker='o', label='SHA1') plt.plot(file_sizes, ripemd160_times, marker='o', label='RIPEMD-160') plt.plot(file_sizes, sha256_times, marker='o', label='SHA-256') plt.plot(file_sizes, sha512_times, marker='o', label='SHA-512') plt.xlabel("Rozmiar pliku") plt.ylabel("Sredni czas obliczen [s]") plt.title("Porównanie wydajności funkcji skrótu") plt.legend() plt.grid(True) plt.tight_layout() plt.show()