{"id":22433676,"url":"https://github.com/nlitsme/pycryptobenchmarking","last_synced_at":"2025-08-01T12:34:10.335Z","repository":{"id":71128509,"uuid":"74835713","full_name":"nlitsme/pyCryptoBenchmarking","owner":"nlitsme","description":"benchmarking the python pyCrypto and cryptography moduls","archived":false,"fork":false,"pushed_at":"2023-11-09T18:04:03.000Z","size":7,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-11-10T12:03:53.318Z","etag":null,"topics":["benchmark","cryptography-library","pycrypto","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nlitsme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-11-26T16:03:43.000Z","updated_at":"2023-11-09T18:04:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f4bf7f6-94ce-40a3-980e-039bd0d0c7b6","html_url":"https://github.com/nlitsme/pyCryptoBenchmarking","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlitsme%2FpyCryptoBenchmarking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlitsme%2FpyCryptoBenchmarking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlitsme%2FpyCryptoBenchmarking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nlitsme%2FpyCryptoBenchmarking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nlitsme","download_url":"https://codeload.github.com/nlitsme/pyCryptoBenchmarking/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228377526,"owners_count":17910449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["benchmark","cryptography-library","pycrypto","python"],"created_at":"2024-12-05T22:15:38.143Z","updated_at":"2024-12-05T22:15:38.749Z","avatar_url":"https://github.com/nlitsme.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"results\n=======\n\nsymmetric crypto\n----------------\n\nIn iterations per second.\n\n| pycrypt   | cryptography  |    factor |  algorithm\n| ---------:| -------------:|  --------:|:-----\n|  756499.3 |      379890.2 |      0.50 | AES\n|  424332.1 |      259299.5 |      0.61 | 3DES.64\n|  229043.5 |      259282.9 |      1.13 | 3DES.128\n|  226057.2 |      255484.5 |      1.13 | 3DES.192\n|  487464.4 |      302878.6 |      0.62 | Blowfish\n|  351429.9 |      317410.7 |      0.90 | CAST5\n|  797340.5 |      361095.3 |      0.45 | RC4\n\nMost symmetric ciphers are significantly faster in `pyCrypto`.\n\nhash algorithms\n---------------\n\nmessage size = 64 kbyte, in Mbyte/sec\n\n| pycrypt   | cryptography  |    factor |  algorithm\n| ---------:| -------------:|  --------:|:-----\n|        57 |         343   |      5.98 | sha224\n|        53 |         333   |      6.19 | sha256\n|        83 |         487   |      5.85 | sha384\n|        81 |         487   |      6.00 | sha512\n|       910 |         781   |      0.86 | sha1\n|       678 |         419   |      0.62 | md5\n|        40 |         199   |      4.89 | ripemd160\n\n\nmessage size = 32 bytes, in Mbyte/sec\n\n| pycrypt   | cryptography  |    factor |  algorithm\n| ---------:| -------------:|  --------:|:-----\n|      16.2 |           2.8 |      0.17 | sha224\n|      15.7 |           2.9 |      0.18 | sha256\n|      13.0 |           2.8 |      0.21 | sha384\n|      12.4 |           2.8 |      0.22 | sha512\n|      15.3 |           2.8 |      0.19 | sha1\n|      16.2 |           2.8 |      0.18 | md5\n|      14.6 |           1.5 |      0.10 | ripemd160\n\nBoth `pycrypto` and `cryptography` have some call overhead.\nfor `pycrypto` the byterate stabilizes for messages over 1K,\nwhile for `cryptography this happens for messages over 16K.\n\nThat said, `cryptography` is generally faster for very large messages,\nwhile `pycrypto` is fast for smaller messages.\nFor the SHAxxx algorithms, the cross over point is around 1k mesage size.\nfor SHA1 and MD5 `pycrypto` is always faster.\n\nasymmetric crypto\n-----------------\n\n| pow()     | pycrypt   | cryptography  |    factor |  algorithm\n| ---------:| ---------:| -------------:|  --------:|:-----\n|   17267.1 |   12137.1 |      33917.4  |      2.8  | rsa.1024\n|    4920.6 |    4217.5 |      18242.9  |      4.3  | rsa.2048\n|    1440.8 |    1467.3 |       6448.8  |      4.4  | rsa.4096\n\nSo for `RSA` the `cryptography` library is generally faster.\nThe `pycrypt` performance is roughly equal to using the `pow()` function.\n\nrandom numbers\n--------------\n\nin Mbyte/sec\n\n| random | sysrand | pycrypti  |   r/s |    s/p |  msgsize |\n| ------:| -------:| ---------:| -----:| ------:| --------:|\n|  478.0 |    55.9 |       2.0 |   8.6 |   27.4 |       32 |\n|  726.4 |    70.9 |       3.1 |  10.2 |   22.6 |       64 |\n| 1148.9 |    81.0 |       3.8 |  14.2 |   21.1 |      128 |\n| 1476.4 |    88.1 |       4.4 |  16.8 |   20.1 |      256 |\n| 1757.5 |    93.4 |       3.9 |  18.8 |   24.2 |      512 |\n| 2141.6 |    94.3 |       2.6 |  22.7 |   36.6 |     1024 |\n| 2339.3 |   100.2 |       1.9 |  23.3 |   53.4 |     2048 |\n| 2405.1 |    94.8 |       1.1 |  25.4 |   83.1 |     4096 |\n| 2361.0 |   101.9 |       0.6 |  23.2 |  158.7 |     8192 |\n| 2568.1 |    97.7 |       0.3 |  26.3 |  286.8 |    16384 |\n\nThe `cryptography` library does not have a builtin PRNG.\nConclusion: secure random numbers are expensive.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlitsme%2Fpycryptobenchmarking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnlitsme%2Fpycryptobenchmarking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnlitsme%2Fpycryptobenchmarking/lists"}