Identity/AttachedServices/Key Stretching Performance Tests: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:
! Browser / Test !! Firefox 23 Desktop !! Google Chrome 28 !! Firefox Android Beta 24 !! Firefox OS !! Android WebView !! Android + OpenSSL
! Browser / Test !! Firefox 23 Desktop !! Google Chrome 28 !! Firefox Android Beta 24 !! Firefox OS !! Android WebView !! Android + OpenSSL
|-
|-
! [1] pbkdf2 key [https://wiki.mozilla.org/Identity/AttachedServices/KeyServerProtocol#stretch-KDF #stretch-KDF]
! [1] 20k PBKDF2-SHA256
|  5.39 ops/sec ±4.20% (30 runs sampled) || 8.12 ops/sec ±1.15% (43 runs sampled) || 0.47 ops/sec ±7.73% (7 runs sampled)  || 0.24 ops/sec ±7.06% (6 runs sampled)  || 0.66 ops/sec ±4.35% (8 runs sampled) || 2.85 ops/sec (**1 run sampled**)
|  5.39 ops/sec ±4.20% (30 runs sampled) || 8.12 ops/sec ±1.15% (43 runs sampled) || 0.47 ops/sec ±7.73% (7 runs sampled)  || 0.24 ops/sec ±7.06% (6 runs sampled)  || 0.66 ops/sec ±4.35% (8 runs sampled) || 2.85 ops/sec (**1 run sampled**)
|-
|-
! [2] Key Stretch w/ Remote Helper
! [2] 20k*PBKDF + scrypt(64k,8,1) + 20k*PBKDF
| 0.66 ops/sec ±10.70% (8 runs sampled) || 0.79 ops/sec ±1.98% (8 runs sampled) || 0.16 ops/sec ±9.02% (5 runs sampled) || 0.10 ops/sec ±3.37% (5 runs sampled)  || 0.18 ops/sec ±21.96% (6 runs sampled) || --
| 0.66 ops/sec ±10.70% (8 runs sampled) || 0.79 ops/sec ±1.98% (8 runs sampled) || 0.16 ops/sec ±9.02% (5 runs sampled) || 0.10 ops/sec ±3.37% (5 runs sampled)  || 0.18 ops/sec ±21.96% (6 runs sampled) || --
|-
|-
|-
|-
! [3] Key Stretch w/ local code
! [3] 20kPBKDF + local(scrypt(64k,8,1)) + 20kPBKDF
| -- || -- || -- || --  || -- || 0.1369 ops/sec (10 runs sampled, extremes discarded -- 7362-7505msec)
| -- || -- || -- || --  || -- || 0.1369 ops/sec (10 runs sampled, extremes discarded -- 7362-7505msec)
|-
|-
Line 18: Line 18:


'''Tests'''
'''Tests'''
* [1] 20k PBKDF2, pdbkdf2.derive(...) - Client pdbkdf2 derivation [https://wiki.mozilla.org/Identity/AttachedServices/KeyServerProtocol#stretch-KDF #stretch-KDF]
* [1] '''20k PBKDF2-SHA256''', pdbkdf2.derive(...) - Client pdbkdf2 derivation [https://wiki.mozilla.org/Identity/AttachedServices/KeyServerProtocol#stretch-KDF #stretch-KDF]
* [2] keyStretch.derive(email, password) - Full Key Stretch with a remote helper at "http://scrypt.dev.lcip.org/".  [https://wiki.mozilla.org/Identity/AttachedServices/KeyServerProtocol#stretch-KDF #stretch-KDF + #main-KDF]
* [2] '''20k*PBKDF+scrypt(64k,8,1)+20k*PBKDF''' keyStretch.derive(email, password) - Full Key Stretch with a remote helper at "http://scrypt.dev.lcip.org/".  [https://wiki.mozilla.org/Identity/AttachedServices/KeyServerProtocol#stretch-KDF #stretch-KDF + #main-KDF]
* [3]  20k PBKDF2, scrypt 65536 iter, 20k PBKDF2.
* [3]  '''20kPBKDF + local(scrypt(64k,8,1)) + 20kPBKDF'''


'''Test Framework'''
'''Test Framework'''

Revision as of 17:48, 20 August 2013

Test Results (in ops/sec)
Browser / Test Firefox 23 Desktop Google Chrome 28 Firefox Android Beta 24 Firefox OS Android WebView Android + OpenSSL
[1] 20k PBKDF2-SHA256 5.39 ops/sec ±4.20% (30 runs sampled) 8.12 ops/sec ±1.15% (43 runs sampled) 0.47 ops/sec ±7.73% (7 runs sampled) 0.24 ops/sec ±7.06% (6 runs sampled) 0.66 ops/sec ±4.35% (8 runs sampled) 2.85 ops/sec (**1 run sampled**)
[2] 20k*PBKDF + scrypt(64k,8,1) + 20k*PBKDF 0.66 ops/sec ±10.70% (8 runs sampled) 0.79 ops/sec ±1.98% (8 runs sampled) 0.16 ops/sec ±9.02% (5 runs sampled) 0.10 ops/sec ±3.37% (5 runs sampled) 0.18 ops/sec ±21.96% (6 runs sampled) --
[3] 20kPBKDF + local(scrypt(64k,8,1)) + 20kPBKDF -- -- -- -- -- 0.1369 ops/sec (10 runs sampled, extremes discarded -- 7362-7505msec)


Tests

Test Framework

These performance tests use Benchmark.js

  • "ops/sec" stands for operations per second. That is how many times a test is projected to execute in a second.
  • A test is repeatedly executed until it reaches the minimum time needed to get a percentage uncertainty for the measurement of less than or equal to 1%. The number of iterations will vary depending on the resolution of the environment’s timer and how many times a test can execute in the minimum run time. We collect completed test runs for 5 seconds (configurable), or at least 5 runs (also configurable), and then perform statistical analysis on the sample. So, a test may be repeated 100,000 times in 50 ms (the minimum run time for most environments), and then repeated 100 times more (5 seconds). A larger sample size (in this example, 100), leads to a smaller margin of error.

Test Suite Page: http://v14d.com/picl/benchmark.html