Skip to content

Instantly share code, notes, and snippets.

@bwo
Created February 27, 2019 22:56
Show Gist options
  • Save bwo/928811e28130b6a643bb67cd3334694c to your computer and use it in GitHub Desktop.
Save bwo/928811e28130b6a643bb67cd3334694c to your computer and use it in GitHub Desktop.
(crypto) Ben-Wolfson-Tower ~/src/all-the-things/crypto4/service 02:56:23 $ git checkout -
Switched to branch 'feature/crypto-py3-container'
(crypto) Ben-Wolfson-Tower ~/src/all-the-things/crypto4/service 02:56:25 $ sh generate_all.sh
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
{"algorithm": "ecies-p384-aes-128-gcm", "created": "2019-02-27T22:56:27.607519", "data": {"key": "AssAMFyNTNUXi0GR8Zv1uDf8ULrlFJTeAW4DBaqho3qmtkqREMmZeSdkoYKEnabMeMXjNQ==", "pub": "AssAMDxIgXWedC0PlXxTbDDZH68kd/Qy8GLSBl3DtZX2uRohUmanTipJ2AtHPp/i8DjyfwAwOdqxxPdY6HsGZtQgnjFtdymfhFU8m0OgtoohABLyWNVaUh9iAnpDBOTcktanJ5eg"}, "operation": "encrypt"}
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
{"algorithm": "aes-256-gcm", "created": "2019-02-27T22:56:28.022133", "data": {"key": "GVfsuQ6n+WtWxumUlyVBgZCLPyrlQOxld0SM4LKvxE4="}, "operation": "encrypt"}
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
{"algorithm": "ecdsa-p384", "created": "2019-02-27T22:56:28.480193", "data": {"key": "AssAMK57VM3e5wg+kNZsdi3iL/0TBhFzCjfq7Tm3e6MzC3zDwDq5iLeJiuubcUwR3jxbQA==", "pub": "AssAME+Jmd2PSs/C1rQy0CI/oFykugl6jEgRTUcQ36Y1ZYFlcawo8V92r1mddJOxpRuNqgAvFvg3H3e114mSYJns9Q+j8ox70bEe3nDGJn7Yl+0UEMhbJyZBKvthde8rq7ccAUU="}, "operation": "sign"}
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
{"algorithm": "hmac-sha224", "created": "2019-02-27T22:56:28.959948", "data": {"key": "31b6557fcbffea17ee75cc23016ed13d283828e30f0a195e999a100f"}, "operation": "crypt_hash"}
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
{"algorithm": "hmac-sha256", "created": "2019-02-27T22:56:29.319504", "data": {"key": "kSVhIbsgtigctJhU2BQA4Wbl370zLoWm9UZNIMs9+Ak="}, "operation": "crypt_hash"}
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
Enter master password:
{"algorithm": "ecies-p384-aes-128-gcm", "created": "2019-02-27T22:56:30.647561", "encrypted_data": "eXfLHSf9T3QmP69tycdFciVRlHED+eAzitti9Vgc7V0OdO7WfjBrr6qPZoOZsazGFeG2pwq/lsqvHsRE0YTmEc3LowM+0UFLnK4WsL3smS3aiwhhVKxGQW8EiNkR1zBOEBu7RpfZ4vged772BhEHxHn2cnKCXdC2ouRlkfpt+5uWaN3TfCBuHvJLQtvU1KC3AaSRZrfVOv7yHSeZftaW7JDiuQ06ZUVM/bYqh9DVylzUAEsWYqmW9h9qvDd/xi2rocxYYXX++uPamn/WsNAmcfMZG2kxjYN6ngXKPP8QRgUMreeMSfwPu5vXrDtehHMDha5s3XkL", "iv": "DEM0Ys2VW0lHsslL", "nonce": "6YjVeDi/J6sw3nxVjPL6g4L9HfE=", "operation": "encrypt"}
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
Enter master password:
{"algorithm": "aes-256-gcm", "created": "2019-02-27T22:56:31.442248", "encrypted_data": "wDDMvgWkuwdEeXxPsUBJfTKfd1g+OkQZgJOBnIh7822cJHOg7lVb8x/yWRaInPhOZrMiSWzRky9WfC2926hQ+g4gKewN9fE=", "iv": "vfv7Ew9rSV2YJjYr", "nonce": "kFi0dqrvs7QQkr0b/3FjXz00riw=", "operation": "encrypt"}
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
Enter master password:
{"algorithm": "ecdsa-p384", "created": "2019-02-27T22:56:32.243753", "encrypted_data": "TOyYeVJdpmt7GEGTHrUpuqKcruWIZc18ghr0feJTAOM3bKShj2YrlX3JP0WZgeqhsk5k9R1rU/Otv5cowEa0n//X9qhVUMmBuVpTdcvv+09tKWGj1LiRYNiDreXVPgoHgJO1medD02UZGaWI8nifnx+pTpuwB26dk3/jDR4irsMgQ1+2yoolmBAyJheqppoKLc5ExNAlvZ/fg4zlP6Li+K/xZM/87+f2hb7cH1yKafu8gTGQVzE6fSsIdRXiB/u4aaDMEwk+cqPea+KI3UTmBTpj3fc9zOXhgeq33ttC1qrWkmd4bQKabrLFiUmRGapkHPFTF3Sk", "iv": "ajSbUFjODVsS6hC4", "nonce": "LuqQW+cgBqtOaReAqzYQJ+ipOZ8=", "operation": "sign"}
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
Enter master password:
{"algorithm": "hmac-sha224", "created": "2019-02-27T22:56:33.138346", "encrypted_data": "13KCKRD5jtxo35yq/xpKsTqY4Tpgkq49XAVig/w+p1fRWazmr9k6ddcIuxO3P1Ie5yEZPIV9cLWu2GAIHkKPo0ebcLjDiQWKrVhHnMfEsfArUFo=", "iv": "Kj0kE1h+T5Z/H0IB", "nonce": "0WEdcAqwE5ltktKkihjRJYbPF44=", "operation": "crypt_hash"}
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
Enter master password:
{"algorithm": "hmac-sha256", "created": "2019-02-27T22:56:33.962221", "encrypted_data": "PZ5h78Arsf1hhoA1fsTjxjumZVPJZhmKdVH98hQuLl3sAy+FlTYpCUfSaKzVnmybmBlyyR8AgorUchBzxXjY6Gnq0fePd+g=", "iv": "pTLi4kXAiWci/TO1", "nonce": "fUZtFcAnboX/gdQcbPTpqjwTAn0=", "operation": "crypt_hash"}
(crypto) Ben-Wolfson-Tower ~/src/all-the-things/crypto4/service 02:51:52 $ mankey benchmark
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
Crypto algorithm benchmarks
encrypt
=======
aes-256-gcm
-----------
size (bytes) encrypt timing decrypt timing encrypt/decrypt ratio
10 0.043020ms 0.027299ms 1.575895
100 0.038872ms 0.025611ms 1.517781
1000 0.039279ms 0.028040ms 1.400816
10000 0.048800ms 0.036180ms 1.348797
100000 0.139349ms 0.138650ms 1.005038
1000000 0.939162ms 1.320081ms 0.711443
ecies-p384-aes-128-gcm
----------------------
size (bytes) encrypt timing decrypt timing encrypt/decrypt ratio
10 2.489939ms 2.365630ms 1.052548
100 2.422819ms 2.306709ms 1.050336
1000 2.456970ms 2.291930ms 1.072009
10000 2.397091ms 2.295210ms 1.044389
100000 2.502589ms 2.462890ms 1.016119
1000000 3.480349ms 3.499298ms 0.994585
sign
====
ecdsa-p384
----------
size (bytes) sign timing verify timing sign/verify ratio
10 1.170809ms 0.756359ms 1.547954
100 1.167989ms 0.764940ms 1.526903
1000 1.179559ms 0.750949ms 1.570757
10000 1.176729ms 0.761111ms 1.546068
100000 1.276572ms 0.842490ms 1.515236
1000000 2.156911ms 1.739841ms 1.239718
crypt_hash
==========
hmac-sha224
-----------
size (bytes) hash timing
10 0.004802ms
100 0.004840ms
1000 0.008039ms
10000 0.039890ms
100000 0.358212ms
1000000 3.556941ms
hmac-sha256
-----------
size (bytes) hash timing
10 0.004649ms
100 0.004849ms
1000 0.008180ms
10000 0.039940ms
100000 0.364170ms
1000000 3.530469ms
(crypto) Ben-Wolfson-Tower ~/src/all-the-things/crypto4/service 02:52:01 $
(crypto) Ben-Wolfson-Tower ~/src/all-the-things/crypto4/service 02:52:59 $ mankey benchmark
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
Crypto algorithm benchmarks
encrypt
=======
aes-256-gcm
-----------
size (bytes) encrypt timing decrypt timing encrypt/decrypt ratio
10 0.022612ms 0.013921ms 1.624251
100 0.022380ms 0.014062ms 1.591556
1000 0.022120ms 0.014498ms 1.525736
10000 0.029399ms 0.020800ms 1.413457
100000 0.080352ms 0.083420ms 0.963217
1000000 0.911109ms 1.317759ms 0.691408
ecies-p384-aes-128-gcm
----------------------
size (bytes) encrypt timing decrypt timing encrypt/decrypt ratio
10 2.473910ms 2.361221ms 1.047725
100 2.478230ms 2.284930ms 1.084598
1000 2.397470ms 2.290881ms 1.046528
10000 2.410891ms 2.290859ms 1.052396
100000 2.459612ms 2.358329ms 1.042947
1000000 3.520939ms 3.462481ms 1.016883
sign
====
ecdsa-p384
----------
size (bytes) sign timing verify timing sign/verify ratio
10 1.166720ms 0.755279ms 1.544754
100 1.161950ms 0.748489ms 1.552394
1000 1.173398ms 0.749042ms 1.566532
10000 1.177549ms 0.755680ms 1.558265
100000 1.270821ms 0.849159ms 1.496565
1000000 2.164440ms 1.746590ms 1.239238
crypt_hash
==========
hmac-sha224
-----------
size (bytes) hash timing
10 0.005109ms
100 0.005260ms
1000 0.009429ms
10000 0.042980ms
100000 0.358531ms
1000000 3.509572ms
hmac-sha256
-----------
size (bytes) hash timing
10 0.004940ms
100 0.005801ms
1000 0.009620ms
10000 0.043869ms
100000 0.357730ms
1000000 3.512042ms
(crypto) Ben-Wolfson-Tower ~/src/all-the-things/crypto4/service 02:53:05 $ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
(crypto) Ben-Wolfson-Tower ~/src/all-the-things/crypto4/service 02:53:12 $ mankey benchmark
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
utils.DeprecatedIn23,
Crypto algorithm benchmarks
encrypt
=======
aes-256-gcm
-----------
size (bytes) encrypt timing decrypt timing encrypt/decrypt ratio
10 0.028520ms 0.017540ms 1.625934
100 0.025899ms 0.017669ms 1.465794
1000 0.027411ms 0.019262ms 1.423072
10000 0.034280ms 0.025911ms 1.322967
100000 0.101671ms 0.101731ms 0.999414
1000000 0.964620ms 1.391170ms 0.693388
ecies-p384-aes-128-gcm
----------------------
size (bytes) encrypt timing decrypt timing encrypt/decrypt ratio
10 2.471561ms 2.373021ms 1.041525
100 2.427971ms 2.279201ms 1.065273
1000 2.398980ms 2.292180ms 1.046593
10000 2.390249ms 2.290120ms 1.043722
100000 2.449570ms 2.418270ms 1.012943
1000000 3.462720ms 3.467269ms 0.998688
sign
====
ecdsa-p384
----------
size (bytes) sign timing verify timing sign/verify ratio
10 1.165919ms 0.754099ms 1.546109
100 1.163480ms 0.751820ms 1.547552
1000 1.166160ms 0.747459ms 1.560166
10000 1.174822ms 0.763061ms 1.539617
100000 1.264582ms 0.850151ms 1.487480
1000000 2.245829ms 1.744180ms 1.287613
crypt_hash
==========
hmac-sha224
-----------
size (bytes) hash timing
10 0.005112ms
100 0.005159ms
1000 0.008371ms
10000 0.040240ms
100000 0.355730ms
1000000 3.507781ms
hmac-sha256
-----------
size (bytes) hash timing
10 0.004961ms
100 0.005112ms
1000 0.008371ms
10000 0.040209ms
100000 0.355821ms
1000000 3.521600ms
(crypto) Ben-Wolfson-Tower ~/src/all-the-things/crypto4/service 02:53:20 $
@bwo
Copy link
Author

bwo commented Feb 27, 2019

benchmark is pretty noisy, I just ran it again on the dev branch and got much lower numbers, more in line with master:

(crypto) Ben-Wolfson-Tower ~/src/all-the-things/crypto4/service 02:56:33 $ mankey benchmark
/home/benwolfson/src/all-the-things/deployable/crypto/src/.venv/local/lib/python2.7/site-packages/cryptography/hazmat/primitives/constant_time.py:26: CryptographyDeprecationWarning: Support for your Python version is deprecated. The next version of cryptography will remove support. Please upgrade to a 2.7.x release that supports hmac.compare_digest as soon as possible.
  utils.DeprecatedIn23,
Crypto algorithm benchmarks

encrypt
=======

aes-256-gcm
-----------
size (bytes)    encrypt timing  decrypt timing  encrypt/decrypt ratio
10              0.021091ms      0.013371ms      1.577389
100             0.019541ms      0.013258ms      1.473836
1000            0.020752ms      0.014160ms      1.465567
10000           0.026829ms      0.019920ms      1.346858
100000          0.079291ms      0.084820ms      0.934816
1000000         0.919769ms      1.354320ms      0.679137

ecies-p384-aes-128-gcm
----------------------
size (bytes)    encrypt timing  decrypt timing  encrypt/decrypt ratio
10              2.462871ms      2.891960ms      0.851627
100             2.707989ms      2.399900ms      1.128376
1000            2.481060ms      2.339339ms      1.060582
10000           2.403009ms      2.298169ms      1.045619
100000          2.450941ms      2.360220ms      1.038437
1000000         3.508050ms      3.534522ms      0.992511

sign
====

ecdsa-p384
----------
size (bytes)    sign timing     verify timing   sign/verify ratio
10              1.172791ms      0.763700ms      1.535669
100             1.180918ms      0.768411ms      1.536831
1000            1.168070ms      0.754161ms      1.548834
10000           1.197591ms      0.766490ms      1.562436
100000          1.293390ms      0.874131ms      1.479630
1000000         2.165349ms      1.743550ms      1.241919

crypt_hash
==========

hmac-sha224
-----------
size (bytes)    hash timing
10              0.004981ms
100             0.005000ms
1000            0.008368ms
10000           0.040171ms
100000          0.360861ms
1000000         3.523331ms

hmac-sha256
-----------
size (bytes)    hash timing
10              0.004880ms
100             0.005071ms
1000            0.008290ms
10000           0.040121ms
100000          0.358920ms
1000000         3.512530ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment