Performance test of Node.js

When performing encryption/decryption, there are 3 stages which could impact performance:

  • PBKDF2 Key Derivation
  • AES Encryption/Decryption
  • Base64 Encoding/Decoding

I measured the performance of these stages and here are the results.

PBKDF2 Performance

pbkdf2_node

(node = node:crypto. The three parameters on the X-axis are salt length (bits), password length (bits), and key iteration count. The Y-axis is linear.)

Conclusions:

  1. The length of salt and password doesn't significantly affect performance.
  2. Time increases linearly with the key iteration count for sjcl.
  3. We can only achieve around 3X performance improvement by switching to node:crypto.

AES Encryption/Decryption Performance

aes_node

(node = node:crypto. The two parameters on the X-axis are plaintext size (bytes) and key size (bits). The Y-axis is logarithmic.)

Conclusions:

  1. Performance improves with larger plaintext sizes.
  2. AES-128 is faster than AES-256 for sjcl and node:crypto, though the difference is not significant.
  3. We achieved at least 7X performance improvement in AES encryption/decryption, and in some cases up to 380X to 540X with larger plaintext sizes.

Base64 Encoding/Decoding Performance

(The Y-axis is linear. The encoding performance of node:buffer is hidden)
base64_node

(The Y-axis is logarithmic. The encoding performance of node:buffer is shown)
base64_node_with-node-encode

(node = node:buffer)

Conclusions:

  1. Base64 decoding performance of node:buffer is much slower than encoding (for Node.js v18.20.2)
  2. We can get at least 10X performance improvement by switching to node:buffer, and in some cases up to 100X.

Tables

PBKDF2 Performance (Windows 11 Node.js v18.20.2)

(node = node:crypto)

Case ID Library Salt Length (bits) Password Length (bits) Key Iteration Count Key Size (bits) Digest Function Time (ms)
1 sjcl 256 80 101 256 SHA-256 1043/4000 = 0.26075
2 node 256 80 101 256 SHA-256 965/20000 = 0.04825
3 node 256 80 101 256 SHA-512 1610/20000 = 0.0805
4 sjcl 256 80 101 512 SHA-256 2010/4000 = 0.5025
5 node 256 80 101 512 SHA-512 1606/20000 = 0.0803
6 sjcl 256 240 101 256 SHA-256 1027/4000 = 0.25675
7 node 256 240 101 256 SHA-256 915/20000 = 0.04575
8 node 256 240 101 256 SHA-512 1615/20000 = 0.08075
9 sjcl 256 240 101 512 SHA-256 2052/4000 = 0.513
10 node 256 240 101 512 SHA-512 1601/20000 = 0.08005
11 sjcl 512 240 101 256 SHA-256 1034/4000 = 0.2585
12 node 512 240 101 256 SHA-256 923/20000 = 0.04615
13 node 512 240 101 256 SHA-512 1627/20000 = 0.08135
14 sjcl 512 240 101 512 SHA-256 2062/4000 = 0.5155
15 node 512 240 101 512 SHA-512 1595/20000 = 0.07975
16 sjcl 256 80 10001 256 SHA-256 1030/40 = 25.75
17 node 256 80 10001 256 SHA-256 824/200 = 4.12
18 node 256 80 10001 256 SHA-512 1746/200 = 8.73
19 sjcl 256 80 10001 512 SHA-256 2272/40 = 56.8
20 node 256 80 10001 512 SHA-512 1715/200 = 8.575
PBKDF2 Performance (macOS 13.6.7 Node.js v18.20.2)

(node = node:crypto)

Case ID Library Salt Length (bits) Password Length (bits) Key Iteration Count Key Size (bits) Digest Function Time (ms)
1 sjcl 256 80 101 256 SHA-256 1296/4000 = 0.324
2 node 256 80 101 256 SHA-256 1461/20000 = 0.07305
3 node 256 80 101 256 SHA-512 1774/20000 = 0.0887
4 sjcl 256 80 101 512 SHA-256 2519/4000 = 0.62975
5 node 256 80 101 512 SHA-512 1800/20000 = 0.09
6 sjcl 256 240 101 256 SHA-256 1252/4000 = 0.313
7 node 256 240 101 256 SHA-256 1435/20000 = 0.07175
8 node 256 240 101 256 SHA-512 1774/20000 = 0.0887
9 sjcl 256 240 101 512 SHA-256 2455/4000 = 0.61375
10 node 256 240 101 512 SHA-512 1791/20000 = 0.08955
11 sjcl 512 240 101 256 SHA-256 1251/4000 = 0.31275
12 node 512 240 101 256 SHA-256 1443/20000 = 0.07215
13 node 512 240 101 256 SHA-512 1800/20000 = 0.09
14 sjcl 512 240 101 512 SHA-256 2462/4000 = 0.6155
15 node 512 240 101 512 SHA-512 1834/20000 = 0.0917
16 sjcl 256 80 10001 256 SHA-256 1204/40 = 30.1
17 node 256 80 10001 256 SHA-256 1311/200 = 6.555
18 node 256 80 10001 256 SHA-512 1676/200 = 8.38
19 sjcl 256 80 10001 512 SHA-256 2387/40 = 59.675
20 node 256 80 10001 512 SHA-512 1679/200 = 8.395
Encryption/Decryption Performance (Windows 11 Node.js v18.20.2)

(node = node:crypto, Mode: AES-GCM, IV Size: 96 bits, Authentication Tag Size: 64 bits, No Associated Data)

Case ID Library Operation Test Count Plaintext Size (bytes) Key Size (bits) Time (ms) Speed (bytes/s)
1 node encrypt 50000 256 256 289.77 44,173,239.16
2 sjcl encrypt 250 256 256 13.54 4,726,735.60
3 node decrypt 50000 256 256 293.31 43,639,924.26
4 sjcl decrypt 250 256 256 11.66 5,490,404.66
5 node encrypt 4000 1280000 128 1,762.25 2,905,368,735.57
6 sjcl encrypt 20 1280000 128 3,613.83 7,083,898.32
7 node decrypt 4000 1280000 128 1,630.63 3,139,893,412.88
8 sjcl decrypt 20 1280000 128 3,725.56 6,871,455.73
9 node encrypt 4000 1280000 256 1,945.79 2,631,328,743.91
10 sjcl encrypt 20 1280000 256 3,721.03 6,879,811.28
11 node decrypt 4000 1280000 256 1,797.89 2,847,779,193.87
12 sjcl decrypt 20 1280000 256 3,633.05 7,046,423.18
Encryption/Decryption Performance (macOS 13.6.7 Node.js v18.20.2)

(node = node:crypto, Mode: AES-GCM, IV Size: 96 bits, Authentication Tag Size: 64 bits, No Associated Data)

Case ID Library Operation Test Count Plaintext Size (bytes) Key Size (bits) Time (ms) Speed (bytes/s)
1 node encrypt 50000 256 256 268.25 47,716,132.02
2 sjcl encrypt 250 256 256 15.99 4,002,843.27
3 node decrypt 50000 256 256 264.58 48,378,180.28
4 sjcl decrypt 250 256 256 13.21 4,846,039.80
5 node encrypt 4000 1280000 128 1,613.00 3,174,217,468.21
6 sjcl encrypt 20 1280000 128 4,386.54 5,836,036.53
7 node decrypt 4000 1280000 128 1,562.91 3,275,944,947.97
8 sjcl decrypt 20 1280000 128 4,347.18 5,888,878.57
9 node encrypt 4000 1280000 256 1,977.12 2,589,622,185.79
10 sjcl encrypt 20 1280000 256 4,455.87 5,745,228.63
11 node decrypt 4000 1280000 256 1,869.29 2,739,001,615.11
12 sjcl decrypt 20 1280000 256 4,526.24 5,655,902.75
Base64 Performance (Windows 11 Node.js v18.20.2)

(node = node:buffer)

Case ID Library Operation Test Count Data Size (bytes) Time (ms) Speed (bytes/s)
1 node encode 5000 25600 27.73 4,616,006,001.24
2 node decode 5000 25600 331.14 386,546,374.24
3 sjcl encode 500 25600 186.17 68,754,216.57
4 sjcl decode 500 25600 393.98 32,489,016.55
5 node encode 5000 51200 45.81 5,587,945,752.44
6 node decode 5000 51200 591.07 433,114,661.18
7 sjcl encode 500 51200 322.08 79,482,223.00
8 sjcl decode 500 51200 760.68 33,654,067.99
9 node encode 5000 102400 433.49 1,181,100,273.37
10 node decode 5000 102400 1,159.00 441,760,519.21
11 sjcl encode 500 102400 1,063.84 48,127,651.07
12 sjcl decode 500 102400 1,603.93 31,921,620.45
Base64 Performance (macOS 13.6.7 Node.js v18.20.2)

(node = node:buffer)

Case ID Library Operation Test Count Data Size (bytes) Time (ms) Speed (bytes/s)
1 node encode 5000 25600 28.11 4,552,949,126.45
2 node decode 5000 25600 179.42 713,415,534.44
3 sjcl encode 500 25600 255.97 50,005,111.85
4 sjcl decode 500 25600 310.28 41,253,604.48
5 node encode 5000 51200 47.70 5,367,283,751.42
6 node decode 5000 51200 467.30 547,827,586.71
7 sjcl encode 500 51200 513.81 49,824,163.91
8 sjcl decode 500 51200 592.57 43,201,561.25
9 node encode 5000 102400 526.78 971,942,942.07
10 node decode 5000 102400 834.51 613,531,412.05
11 sjcl encode 500 102400 1,365.87 37,485,249.86
12 sjcl decode 500 102400 1,322.40 38,717,543.79

Conclusion

  1. For native implementation: We don't need to care too much about the speed impacts from the parameters of encryption/decryption because the native encryption is too fast.
  2. For native implementation: The base64 decoding speed of Node.js differs in v18.20.2 and v22.2.0. The newer implementation is noticeably faster.
  3. For native implementation: The base64 encoding/decoding doesn't slow down the flow too much, because Node.js uses simdutf inside.

I will post the raw test results and payloads below.

Windows 11 Node.js v18.20.2
--------pbkdf2 performance--------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 965.0587999969721 ms
pbkdf2(sjcl, sha256, cached, 20000): 43.23309999704361 ms
pbkdf2(sjcl, sha256, 4000): 1042.9499000012875 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1609.66930000484 ms
pbkdf2(sjcl, sha256, cached, 20000): 44.92049999535084 ms
pbkdf2(sjcl, sha256, 4000): 999.1794999986887 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1605.7835000008345 ms
pbkdf2(sjcl, sha256, cached, 20000): 36.066200003027916 ms
pbkdf2(sjcl, sha256, 4000): 2009.855499997735 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 914.6423999965191 ms
pbkdf2(sjcl, sha256, cached, 20000): 41.94970001280308 ms
pbkdf2(sjcl, sha256, 4000): 1027.2528999894857 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1614.664800003171 ms
pbkdf2(sjcl, sha256, cached, 20000): 42.52830000221729 ms
pbkdf2(sjcl, sha256, 4000): 1016.7096000015736 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1601.0723000019789 ms
pbkdf2(sjcl, sha256, cached, 20000): 37.33709999918938 ms
pbkdf2(sjcl, sha256, 4000): 2052.0461000055075 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 923.448399990797 ms
pbkdf2(sjcl, sha256, cached, 20000): 56.15089999139309 ms
pbkdf2(sjcl, sha256, 4000): 1033.7347999960184 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1626.9845999926329 ms
pbkdf2(sjcl, sha256, cached, 20000): 56.69659999012947 ms
pbkdf2(sjcl, sha256, 4000): 1025.5900000035763 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1594.821799993515 ms
pbkdf2(sjcl, sha256, cached, 20000): 52.907900005578995 ms
pbkdf2(sjcl, sha256, 4000): 2061.5604000091553 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 256(32), digest method: sha256
pbkdf2(node, 200): 823.7727000117302 ms
pbkdf2(sjcl, sha256, cached, 200): 26.674799993634224 ms
pbkdf2(sjcl, sha256, 40): 1029.7602999955416 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 256(32), digest method: sha512
pbkdf2(node, 200): 1746.4726999998093 ms
pbkdf2(sjcl, sha256, cached, 200): 29.806199997663498 ms
pbkdf2(sjcl, sha256, 40): 1158.9121000021696 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 512(64), digest method: sha512
pbkdf2(node, 200): 1715.4784000068903 ms
pbkdf2(sjcl, sha256, cached, 200): 29.472200006246567 ms
pbkdf2(sjcl, sha256, 40): 2271.5416000038385 ms
--------encryption/decryption performance--------
plaintextLength: 2048(256), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 284.9008000046015 ms, 44927918.769597225 bytes/s
encryption(sjcl, 250): 23.55969999730587 ms, 2716503.1815905385 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 352
plaintextLength: 2048(256), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 271.66589999198914 ms, 47116697.38593414 bytes/s
decryption(sjcl, 250): 11.196999996900558 ms, 5715816.738208077 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 344
----------------
plaintextLength: 2048(256), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 289.7681999951601 ms, 44173239.162246905 bytes/s
encryption(sjcl, 250): 13.53999999165535 ms, 4726735.601140543 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 352
plaintextLength: 2048(256), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 293.30939999222755 ms, 43639924.25861288 bytes/s
decryption(sjcl, 250): 11.656700000166893 ms, 5490404.659902347 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 344
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 1021.9452999979258 ms, 1252513221.6006062 bytes/s
encryption(sjcl, 250): 918.8693000078201 ms, 6965081.976234849 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 897.5552999973297 ms, 1426095974.2578626 bytes/s
decryption(sjcl, 250): 908.21629999578 ms, 7046779.495181641 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 994.4054999947548 ms, 1287201247.3852484 bytes/s
encryption(sjcl, 250): 1014.8452000021935 ms, 6306380.519892262 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 921.965499997139 ms, 1388338283.812108 bytes/s
decryption(sjcl, 250): 958.1042000055313 ms, 6679857.994530294 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 48(6)
encryption(node, 50000): 937.7483000010252 ms, 1364971815.996468 bytes/s
encryption(sjcl, 250): 938.4536000043154 ms, 6819729.819322522 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 48(6)
decryption(node, 50000): 947.8268000036478 ms, 1350457699.6504781 bytes/s
decryption(sjcl, 250): 929.7820000052452 ms, 6883333.942756361 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 981.2607000023127 ms, 1304444374.4633646 bytes/s
encryption(sjcl, 250): 914.8952999860048 ms, 6995335.969151772 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 928.5064000040293 ms, 1378558079.938324 bytes/s
decryption(sjcl, 250): 976.5837000012398 ms, 6553457.732288461 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 128(16), adataLength: 0(0)
encryption(node, 50000): 974.9275999963284 ms, 1312918005.4034994 bytes/s
encryption(sjcl, 250): 895.2586000114679 ms, 7148772.432812171 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34156
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 128(16), adataLength: 0(0)
decryption(node, 50000): 903.0420999974012 ms, 1417431147.4555655 bytes/s
decryption(sjcl, 250): 912.9708999991417 ms, 7010081.044210738 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 987.6598000079393 ms, 1295992810.469466 bytes/s
encryption(sjcl, 250): 1032.4626000076532 ms, 6198771.752073692 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 908.6472000032663 ms, 1408687552.2154238 bytes/s
decryption(sjcl, 250): 938.9329999983311 ms, 6816247.804701055 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 937.9402000010014 ms, 1364692546.4956439 bytes/s
encryption(sjcl, 250): 914.1481000036001 ms, 7001053.767955975 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 928.4724999964237 ms, 1378608413.2862635 bytes/s
decryption(sjcl, 250): 921.5313999950886 ms, 6944961.397988294 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 975.6019999980927 ms, 1312010430.4854875 bytes/s
encryption(sjcl, 250): 926.3797999918461 ms, 6908613.508256908 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 928.0505000054836 ms, 1379235289.4507754 bytes/s
decryption(sjcl, 250): 961.7233000099659 ms, 6654720.74965188 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 5120000(640000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 1307.6137000024319 ms, 1957764743.5135002 bytes/s
encryption(sjcl, 20): 1850.6246999949217 ms, 6916583.35697947 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 853344
plaintextLength: 5120000(640000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 901.3738999962807 ms, 2840108860.4968076 bytes/s
decryption(sjcl, 20): 1929.0715000033379 ms, 6635316.524026119 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 853336
----------------
plaintextLength: 5120000(640000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 685.0684999972582 ms, 3736852592.1280074 bytes/s
encryption(sjcl, 20): 1872.7003999948502 ms, 6835049.535972332 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 853344
plaintextLength: 5120000(640000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 672.7459999918938 ms, 3805299474.141573 bytes/s
decryption(sjcl, 20): 1926.7031999975443 ms, 6643472.64281095 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 853336
----------------
plaintextLength: 10240000(1280000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 1762.254799991846 ms, 2905368735.5674615 bytes/s
encryption(sjcl, 20): 3613.8294000029564 ms, 7083898.315725435 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 1706680
plaintextLength: 10240000(1280000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 1630.6286000013351 ms, 3139893412.8812704 bytes/s
decryption(sjcl, 20): 3725.5569999963045 ms, 6871455.731324308 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 1706668
----------------
plaintextLength: 10240000(1280000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 1945.7850000113249 ms, 2631328743.9106584 bytes/s
encryption(sjcl, 20): 3721.0322999954224 ms, 6879811.282485103 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 1706680
plaintextLength: 10240000(1280000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 1797.8922000080347 ms, 2847779193.867752 bytes/s
decryption(sjcl, 20): 3633.0488999933004 ms, 7046423.184683038 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 1706668
--------base64 performance--------
dataLength: 2048(256)
encode(node, 5000): 2.9244000017642975 ms, 437696621.26513916 bytes/s
decode(node, 5000): 5.590900003910065 ms, 228943461.53657126 bytes/s
encode(sjcl, 500): 9.614399999380112 ms, 13313363.289259112 bytes/s
decode(sjcl, 500): 3.255500003695488 ms, 39318077.055659816 bytes/s
dataLength: 204800(25600)
encode(node, 5000): 27.729599997401237 ms, 4616006001.240404 bytes/s
decode(node, 5000): 331.13750000298023 ms, 386546374.2368291 bytes/s
encode(sjcl, 500): 186.17039999365807 ms, 68754216.56953004 bytes/s
decode(sjcl, 500): 393.9793000072241 ms, 32489016.554334953 bytes/s
dataLength: 409600(51200)
encode(node, 5000): 45.81290000677109 ms, 5587945752.444476 bytes/s
decode(node, 5000): 591.0675000101328 ms, 433114661.17763424 bytes/s
encode(sjcl, 500): 322.0845999866724 ms, 79482222.99687506 bytes/s
decode(sjcl, 500): 760.6807000041008 ms, 33654067.99444497 bytes/s
dataLength: 819200(102400)
encode(node, 5000): 433.4940999895334 ms, 1181100273.3655708 bytes/s
decode(node, 5000): 1158.9989999979734 ms, 441760519.2074327 bytes/s
encode(sjcl, 500): 1063.8374999910593 ms, 48127651.074934185 bytes/s
decode(sjcl, 500): 1603.928599998355 ms, 31921620.451217413 bytes/s
Windows 11 Node.js v22.2.0
--------pbkdf2 performance--------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 1037.5631 ms
pbkdf2(sjcl, sha256, cached, 20000): 46.5938000000001 ms
pbkdf2(sjcl, sha256, 4000): 1014.8710000000003 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1626.4618999999998 ms
pbkdf2(sjcl, sha256, cached, 20000): 34.557900000000245 ms
pbkdf2(sjcl, sha256, 4000): 993.4209999999998 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1611.732 ms
pbkdf2(sjcl, sha256, cached, 20000): 34.40490000000045 ms
pbkdf2(sjcl, sha256, 4000): 1999.6560000000009 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 1016.3424999999988 ms
pbkdf2(sjcl, sha256, cached, 20000): 38.8773999999994 ms
pbkdf2(sjcl, sha256, 4000): 982.3338000000003 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1612.1439999999984 ms
pbkdf2(sjcl, sha256, cached, 20000): 39.495999999999185 ms
pbkdf2(sjcl, sha256, 4000): 1016.5972000000002 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1621.7293000000009 ms
pbkdf2(sjcl, sha256, cached, 20000): 36.941500000000815 ms
pbkdf2(sjcl, sha256, 4000): 1980.8081999999995 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 1026.7962999999982 ms
pbkdf2(sjcl, sha256, cached, 20000): 53.52610000000277 ms
pbkdf2(sjcl, sha256, 4000): 1027.5614999999998 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1616.4133000000002 ms
pbkdf2(sjcl, sha256, cached, 20000): 52.62840000000142 ms
pbkdf2(sjcl, sha256, 4000): 1052.6841000000022 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1868.3818000000028 ms
pbkdf2(sjcl, sha256, cached, 20000): 66.32570000000123 ms
pbkdf2(sjcl, sha256, 4000): 2249.6402000000016 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 256(32), digest method: sha256
pbkdf2(node, 200): 881.1018000000004 ms
pbkdf2(sjcl, sha256, cached, 200): 27.90299999999843 ms
pbkdf2(sjcl, sha256, 40): 1103.9902000000002 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 256(32), digest method: sha512
pbkdf2(node, 200): 1714.781500000001 ms
pbkdf2(sjcl, sha256, cached, 200): 29.185999999997875 ms
pbkdf2(sjcl, sha256, 40): 1089.7855000000018 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 512(64), digest method: sha512
pbkdf2(node, 200): 1633.053899999999 ms
pbkdf2(sjcl, sha256, cached, 200): 30.846699999998236 ms
pbkdf2(sjcl, sha256, 40): 2241.4239000000016 ms
--------encryption/decryption performance--------
plaintextLength: 2048(256), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 279.7311999999947 ms, 45758213.599341944 bytes/s
encryption(sjcl, 250): 13.463199999998324 ms, 4753698.972013189 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 352
plaintextLength: 2048(256), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 253.46119999999792 ms, 50500826.16195341 bytes/s
decryption(sjcl, 250): 8.56749999999738 ms, 7470090.458128925 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 344
----------------
plaintextLength: 2048(256), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 263.34240000000136 ms, 48605921.4163763 bytes/s
encryption(sjcl, 250): 11.917999999997846 ms, 5370028.528277527 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 352
plaintextLength: 2048(256), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 241.72969999999623 ms, 52951705.97572495 bytes/s
decryption(sjcl, 250): 9.143900000002759 ms, 6999201.653559279 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 344
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 1075.6624999999985 ms, 1189964324.311763 bytes/s
encryption(sjcl, 250): 963.6622999999963 ms, 6641330.681920445 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 1102.3960000000006 ms, 1161107260.9116862 bytes/s
decryption(sjcl, 250): 925.8168000000005 ms, 6912814.716691246 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 1082.9815999999992 ms, 1181922204.4031043 bytes/s
encryption(sjcl, 250): 972.4936999999991 ms, 6581019.49657875 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 1058.837999999996 ms, 1208872367.6332023 bytes/s
decryption(sjcl, 250): 1026.2739000000001 ms, 6236151.966838482 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 48(6)
encryption(node, 50000): 1045.002800000002 ms, 1224877100.8077657 bytes/s
encryption(sjcl, 250): 954.6472000000067 ms, 6704047.317165918 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 48(6)
decryption(node, 50000): 1030.038400000005 ms, 1242672117.8550177 bytes/s
decryption(sjcl, 250): 957.4976999999999 ms, 6684089.162825144 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 1142.9160000000047 ms, 1119942322.9703624 bytes/s
encryption(sjcl, 250): 983.3311000000031 ms, 6508489.358263946 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 1046.2450000000026 ms, 1223422812.0564463 bytes/s
decryption(sjcl, 250): 950.1719000000012 ms, 6735623.311950177 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 128(16), adataLength: 0(0)
encryption(node, 50000): 1064.8313000000053 ms, 1202068346.413177 bytes/s
encryption(sjcl, 250): 1029.1670000000013 ms, 6218621.467652958 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34156
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 128(16), adataLength: 0(0)
decryption(node, 50000): 1019.8983999999982 ms, 1255026971.3140075 bytes/s
decryption(sjcl, 250): 953.5631999999969 ms, 6711668.403310888 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 1066.4699000000037 ms, 1200221403.3419936 bytes/s
encryption(sjcl, 250): 1005.9644999999946 ms, 6362053.531710149 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 1076.9328000000023 ms, 1188560697.5662708 bytes/s
decryption(sjcl, 250): 980.2084000000032 ms, 6529223.785472537 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 1050.3786000000036 ms, 1218608223.7395122 bytes/s
encryption(sjcl, 250): 943.0701000000045 ms, 6786345.999093778 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 1080.5231000000058 ms, 1184611416.4518955 bytes/s
decryption(sjcl, 250): 958.1702000000005 ms, 6679397.877329097 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 1064.4455000000016 ms, 1202504026.7444394 bytes/s
encryption(sjcl, 250): 951.5898000000016 ms, 6725587.012387049 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 1055.3815999999933 ms, 1212831453.5709245 bytes/s
decryption(sjcl, 250): 995.5198999999993 ms, 6428801.6743814 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 5120000(640000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 1471.103099999993 ms, 1740190745.2985532 bytes/s
encryption(sjcl, 20): 1941.259699999995 ms, 6593656.685913808 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 853344
plaintextLength: 5120000(640000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 933.1892999999982 ms, 2743280489.8213096 bytes/s
decryption(sjcl, 20): 1975.3561000000045 ms, 6479844.31769035 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 853336
----------------
plaintextLength: 5120000(640000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 980.175900000002 ms, 2611776110.7980666 bytes/s
encryption(sjcl, 20): 1967.671800000011 ms, 6505149.893391738 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 853344
plaintextLength: 5120000(640000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 820.8246999999974 ms, 3118814528.8512983 bytes/s
decryption(sjcl, 20): 1950.2044000000024 ms, 6563414.583620047 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 853336
----------------
plaintextLength: 10240000(1280000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 3025.148399999991 ms, 1692478954.0903234 bytes/s
encryption(sjcl, 20): 3757.6916999999958 ms, 6812693.015768172 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 1706680
plaintextLength: 10240000(1280000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 3076.5615000000107 ms, 1664195563.781183 bytes/s
decryption(sjcl, 20): 3874.1008 ms, 6607985.00648202 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 1706668
----------------
plaintextLength: 10240000(1280000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 3184.715499999991 ms, 1607678927.6781597 bytes/s
encryption(sjcl, 20): 3866.690699999992 ms, 6620648.5044174995 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 1706680
plaintextLength: 10240000(1280000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 3101.9223000000056 ms, 1650589378.0769398 bytes/s
decryption(sjcl, 20): 3965.2600999999995 ms, 6456070.813614472 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 1706668
--------base64 performance--------
dataLength: 2048(256)
encode(node, 5000): 2.803299999999581 ms, 456604715.87064934 bytes/s
decode(node, 5000): 2.2819999999919673 ms, 560911481.1588544 bytes/s
encode(sjcl, 500): 2.78519999999844 ms, 45957202.35533236 bytes/s
decode(sjcl, 500): 2.6840999999985797 ms, 47688238.14316446 bytes/s
dataLength: 204800(25600)
encode(node, 5000): 16.14990000000398 ms, 7925745670.249874 bytes/s
decode(node, 5000): 139.93970000000263 ms, 914679679.8906785 bytes/s
encode(sjcl, 500): 136.90950000000885 ms, 93492416.52331775 bytes/s
decode(sjcl, 500): 477.8480000000127 ms, 26786760.64355121 bytes/s
dataLength: 409600(51200)
encode(node, 5000): 27.0679999999993 ms, 9457662184.129105 bytes/s
decode(node, 5000): 265.9036999999953 ms, 962754561.1437695 bytes/s
encode(sjcl, 500): 306.9122999999963 ms, 83411450.11131944 bytes/s
decode(sjcl, 500): 922.7583000000013 ms, 27742909.492117234 bytes/s
dataLength: 819200(102400)
encode(node, 5000): 378.617900000012 ms, 1352286830.6014686 bytes/s
decode(node, 5000): 520.8785000000062 ms, 982954758.1633605 bytes/s
encode(sjcl, 500): 1057.3415999999997 ms, 48423328.84660928 bytes/s
decode(sjcl, 500): 1893.9928999999975 ms, 27032836.289935444 bytes/s
macOS 13.6.7 Node.js v18.20.2
--------pbkdf2 performance--------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 1461.3373580016196 ms
pbkdf2(sjcl, sha256, cached, 20000): 53.501404002308846 ms
pbkdf2(sjcl, sha256, 4000): 1295.5406860001385 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1774.4283750019968 ms
pbkdf2(sjcl, sha256, cached, 20000): 54.45330699905753 ms
pbkdf2(sjcl, sha256, 4000): 1284.1002390012145 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1800.4426860027015 ms
pbkdf2(sjcl, sha256, cached, 20000): 45.68115700036287 ms
pbkdf2(sjcl, sha256, 4000): 2518.6126970015466 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 1434.8013110011816 ms
pbkdf2(sjcl, sha256, cached, 20000): 48.0467800013721 ms
pbkdf2(sjcl, sha256, 4000): 1251.745016001165 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1773.8958050012589 ms
pbkdf2(sjcl, sha256, cached, 20000): 56.81401599943638 ms
pbkdf2(sjcl, sha256, 4000): 1249.432473000139 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1790.761572998017 ms
pbkdf2(sjcl, sha256, cached, 20000): 50.08134499937296 ms
pbkdf2(sjcl, sha256, 4000): 2454.976059000939 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 1443.181170001626 ms
pbkdf2(sjcl, sha256, cached, 20000): 76.58987500146031 ms
pbkdf2(sjcl, sha256, 4000): 1251.2496949993074 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1799.5096010006964 ms
pbkdf2(sjcl, sha256, cached, 20000): 71.64207300171256 ms
pbkdf2(sjcl, sha256, 4000): 1244.1884060017765 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1834.1523249968886 ms
pbkdf2(sjcl, sha256, cached, 20000): 71.27665299922228 ms
pbkdf2(sjcl, sha256, 4000): 2461.511521998793 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 256(32), digest method: sha256
pbkdf2(node, 200): 1311.0997480005026 ms
pbkdf2(sjcl, sha256, cached, 200): 30.868584997951984 ms
pbkdf2(sjcl, sha256, 40): 1203.6242559999228 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 256(32), digest method: sha512
pbkdf2(node, 200): 1676.4131760001183 ms
pbkdf2(sjcl, sha256, cached, 200): 30.513128001242876 ms
pbkdf2(sjcl, sha256, 40): 1195.761835001409 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 512(64), digest method: sha512
pbkdf2(node, 200): 1678.9547079987824 ms
pbkdf2(sjcl, sha256, cached, 200): 30.81350800022483 ms
pbkdf2(sjcl, sha256, 40): 2387.288376003504 ms
--------encryption/decryption performance--------
plaintextLength: 2048(256), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 269.027892999351 ms, 47578709.61741085 bytes/s
encryption(sjcl, 250): 24.47877399995923 ms, 2614510.0240766383 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 352
plaintextLength: 2048(256), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 269.9014320001006 ms, 47424720.592053875 bytes/s
decryption(sjcl, 250): 14.491987999528646 ms, 4416233.300916452 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 344
----------------
plaintextLength: 2048(256), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 268.2530930005014 ms, 47716132.01856381 bytes/s
encryption(sjcl, 250): 15.988634999841452 ms, 4002843.2696496383 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 352
plaintextLength: 2048(256), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 264.5820889994502 ms, 48378180.27820696 bytes/s
decryption(sjcl, 250): 13.206659998744726 ms, 4846039.801591251 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 344
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 695.0378400012851 ms, 1841626349.433915 bytes/s
encryption(sjcl, 250): 1121.8523340001702 ms, 5704850.635002582 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 618.9584770016372 ms, 2067990095.5563037 bytes/s
decryption(sjcl, 250): 1097.1938800029457 ms, 5833062.065551093 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 697.6094109974802 ms, 1834837632.3791072 bytes/s
encryption(sjcl, 250): 1121.0343089997768 ms, 5709013.4963936005 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 647.5588319972157 ms, 1976654377.5678184 bytes/s
decryption(sjcl, 250): 1146.045692998916 ms, 5584419.573405311 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 48(6)
encryption(node, 50000): 633.9547959975898 ms, 2019071403.9567993 bytes/s
encryption(sjcl, 250): 1088.3657679967582 ms, 5880376.053888405 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 48(6)
decryption(node, 50000): 594.2554390020669 ms, 2153955884.946554 bytes/s
decryption(sjcl, 250): 1085.1486120000482 ms, 5897809.690973199 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 684.9965540021658 ms, 1868622539.079157 bytes/s
encryption(sjcl, 250): 1102.6271020025015 ms, 5804319.509630084 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 633.0704209990799 ms, 2021891968.9534197 bytes/s
decryption(sjcl, 250): 1120.711004998535 ms, 5710660.439181077 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 128(16), adataLength: 0(0)
encryption(node, 50000): 647.0678340010345 ms, 1978154271.8409235 bytes/s
encryption(sjcl, 250): 1090.0195969976485 ms, 5871454.070759984 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34156
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 128(16), adataLength: 0(0)
decryption(node, 50000): 600.4850309975445 ms, 2131610171.6534448 bytes/s
decryption(sjcl, 250): 1090.6960260011256 ms, 5867812.706226359 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 661.2836149968207 ms, 1935629389.5262382 bytes/s
encryption(sjcl, 250): 1107.9887190014124 ms, 5776232.0953665245 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 629.6352199986577 ms, 2032923126.509233 bytes/s
decryption(sjcl, 250): 1128.3049970008433 ms, 5672225.16696451 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 638.4492719992995 ms, 2004857795.5014167 bytes/s
encryption(sjcl, 250): 1083.4129850007594 ms, 5907257.978817297 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 578.1017550006509 ms, 2214143079.359029 bytes/s
decryption(sjcl, 250): 1090.689210999757 ms, 5867849.370338573 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 717.424047999084 ms, 1784160990.3793387 bytes/s
encryption(sjcl, 250): 1127.3641660027206 ms, 5676958.868306406 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 658.714496999979 ms, 1943178730.435685 bytes/s
decryption(sjcl, 250): 1120.7347620017827 ms, 5710539.38629399 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 5120000(640000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 1132.0834269970655 ms, 2261317442.6469507 bytes/s
encryption(sjcl, 20): 2193.473001997918 ms, 5835494.664553044 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 853344
plaintextLength: 5120000(640000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 1121.8524420000613 ms, 2281940034.3203607 bytes/s
decryption(sjcl, 20): 2244.420450001955 ms, 5703031.2658169065 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 853336
----------------
plaintextLength: 5120000(640000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 1272.7361299991608 ms, 2011414573.4211915 bytes/s
encryption(sjcl, 20): 2273.982748001814 ms, 5628890.54952047 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 853344
plaintextLength: 5120000(640000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 1235.8461470007896 ms, 2071455258.5795004 bytes/s
decryption(sjcl, 20): 2265.1216779984534 ms, 5650910.555635387 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 853336
----------------
plaintextLength: 10240000(1280000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 1612.9959749989212 ms, 3174217468.213722 bytes/s
encryption(sjcl, 20): 4386.538683000952 ms, 5836036.531310453 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 1706680
plaintextLength: 10240000(1280000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 1562.907827001065 ms, 3275944947.965579 bytes/s
decryption(sjcl, 20): 4347.177430998534 ms, 5888878.566918708 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 1706668
----------------
plaintextLength: 10240000(1280000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 1977.1223880015314 ms, 2589622185.7946177 bytes/s
encryption(sjcl, 20): 4455.871406998485 ms, 5745228.634693565 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 1706680
plaintextLength: 10240000(1280000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 1869.2942610010505 ms, 2739001615.1112137 bytes/s
decryption(sjcl, 20): 4526.244725998491 ms, 5655902.751558055 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 1706668
--------base64 performance--------
dataLength: 2048(256)
encode(node, 5000): 2.6463559977710247 ms, 483683979.43365127 bytes/s
decode(node, 5000): 4.729670997709036 ms, 270631932.03502065 bytes/s
encode(sjcl, 500): 7.278257999569178 ms, 17586625.811777588 bytes/s
decode(sjcl, 500): 3.0966410003602505 ms, 41335111.16887912 bytes/s
dataLength: 204800(25600)
encode(node, 5000): 28.113646000623703 ms, 4552949126.454829 bytes/s
decode(node, 5000): 179.41857700049877 ms, 713415534.4440402 bytes/s
encode(sjcl, 500): 255.97382999956608 ms, 50005111.850776695 bytes/s
decode(sjcl, 500): 310.2759180031717 ms, 41253604.47686809 bytes/s
dataLength: 409600(51200)
encode(node, 5000): 47.696378998458385 ms, 5367283751.420088 bytes/s
decode(node, 5000): 467.30030800029635 ms, 547827586.708626 bytes/s
encode(sjcl, 500): 513.8069159984589 ms, 49824163.9084453 bytes/s
decode(sjcl, 500): 592.5711770020425 ms, 43201561.25297292 bytes/s
dataLength: 819200(102400)
encode(node, 5000): 526.7798940017819 ms, 971942942.0711111 bytes/s
decode(node, 5000): 834.5130989998579 ms, 613531412.045681 bytes/s
encode(sjcl, 500): 1365.8705810010433 ms, 37485249.856158145 bytes/s
decode(sjcl, 500): 1322.39793600142 ms, 38717543.79382593 bytes/s
macOS 13.6.7 Node.js v22.2.0
--------pbkdf2 performance--------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 1542.4389330000001 ms
pbkdf2(sjcl, sha256, cached, 20000): 44.09278500000005 ms
pbkdf2(sjcl, sha256, 4000): 1279.950358 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1812.6811469999998 ms
pbkdf2(sjcl, sha256, cached, 20000): 44.141945999999734 ms
pbkdf2(sjcl, sha256, 4000): 1266.0347629999997 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1781.5884290000004 ms
pbkdf2(sjcl, sha256, cached, 20000): 40.57321400000001 ms
pbkdf2(sjcl, sha256, 4000): 2506.2576629999994 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 1505.3829749999986 ms
pbkdf2(sjcl, sha256, cached, 20000): 46.49447399999917 ms
pbkdf2(sjcl, sha256, 4000): 1214.6791349999985 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1797.7617960000007 ms
pbkdf2(sjcl, sha256, cached, 20000): 43.90531900000133 ms
pbkdf2(sjcl, sha256, 4000): 1212.4593680000016 ms
----------------
saltLength: 256(32), password length: 240(30), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1795.3431810000002 ms
pbkdf2(sjcl, sha256, cached, 20000): 42.43350199999986 ms
pbkdf2(sjcl, sha256, 4000): 2420.700642 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha256
pbkdf2(node, 20000): 1501.5736199999992 ms
pbkdf2(sjcl, sha256, cached, 20000): 68.44977999999901 ms
pbkdf2(sjcl, sha256, 4000): 1214.3207110000003 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 256(32), digest method: sha512
pbkdf2(node, 20000): 1814.4645349999992 ms
pbkdf2(sjcl, sha256, cached, 20000): 68.96602699999858 ms
pbkdf2(sjcl, sha256, 4000): 1216.2815550000014 ms
----------------
saltLength: 512(64), password length: 240(30), key iteration count: 101, key size: 512(64), digest method: sha512
pbkdf2(node, 20000): 1773.4915280000023 ms
pbkdf2(sjcl, sha256, cached, 20000): 70.49158199999874 ms
pbkdf2(sjcl, sha256, 4000): 2422.786855999999 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 256(32), digest method: sha256
pbkdf2(node, 200): 1380.9128640000017 ms
pbkdf2(sjcl, sha256, cached, 200): 30.56755599999815 ms
pbkdf2(sjcl, sha256, 40): 1184.341255999996 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 256(32), digest method: sha512
pbkdf2(node, 200): 1669.622954999999 ms
pbkdf2(sjcl, sha256, cached, 200): 29.962489000005007 ms
pbkdf2(sjcl, sha256, 40): 1219.2504560000016 ms
----------------
saltLength: 256(32), password length: 80(10), key iteration count: 10001, key size: 512(64), digest method: sha512
pbkdf2(node, 200): 1670.6007339999996 ms
pbkdf2(sjcl, sha256, cached, 200): 30.701753999994253 ms
pbkdf2(sjcl, sha256, 40): 2369.6296169999987 ms
--------encryption/decryption performance--------
plaintextLength: 2048(256), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 250.7005480000007 ms, 51056928.68290006 bytes/s
encryption(sjcl, 250): 17.160550000000512 ms, 3729484.194853783 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 352
plaintextLength: 2048(256), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 233.74313000000257 ms, 54760967.734109916 bytes/s
decryption(sjcl, 250): 13.402244999997492 ms, 4775319.358809809 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 344
----------------
plaintextLength: 2048(256), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 245.52572599999985 ms, 52133029.839814045 bytes/s
encryption(sjcl, 250): 14.89907900000253 ms, 4295567.531388291 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 352
plaintextLength: 2048(256), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 229.91283100000146 ms, 55673273.841771446 bytes/s
decryption(sjcl, 250): 14.206536999998207 ms, 4504968.38180959 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 344
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 727.9970649999959 ms, 1758248846.786226 bytes/s
encryption(sjcl, 250): 1130.8500979999953 ms, 5659459.208005504 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 700.126271000001 ms, 1828241637.2860234 bytes/s
decryption(sjcl, 250): 1112.8812440000038 ms, 5750838.22690427 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 791.1922170000034 ms, 1617811667.6291754 bytes/s
encryption(sjcl, 250): 1148.8116670000018 ms, 5570974.062887882 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 765.6656689999945 ms, 1671747933.6271627 bytes/s
decryption(sjcl, 250): 1144.8553639999955 ms, 5590225.806025944 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 48(6)
encryption(node, 50000): 711.3675810000059 ms, 1799351044.6464798 bytes/s
encryption(sjcl, 250): 1123.0313739999983 ms, 5698861.267966686 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 48(6)
decryption(node, 50000): 688.6236040000003 ms, 1858780315.6396008 bytes/s
decryption(sjcl, 250): 1133.0209010000035 ms, 5648616.00907041 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 795.3438280000046 ms, 1609366861.145734 bytes/s
encryption(sjcl, 250): 1230.9875589999938 ms, 5199077.726828621 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 777.0650339999993 ms, 1647223776.6395254 bytes/s
decryption(sjcl, 250): 1181.3154950000026 ms, 5417689.031497878 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 128(16), adataLength: 0(0)
encryption(node, 50000): 710.8908880000017 ms, 1800557612.436294 bytes/s
encryption(sjcl, 250): 1171.6825039999967 ms, 5462230.577098399 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34156
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 96(12), authTagLength: 128(16), adataLength: 0(0)
decryption(node, 50000): 689.1113239999977 ms, 1857464759.9318862 bytes/s
decryption(sjcl, 250): 1154.8549540000022 ms, 5541821.488345962 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 781.9356570000018 ms, 1636963333.9281228 bytes/s
encryption(sjcl, 250): 1174.3482440000007 ms, 5449831.455617177 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 762.4970329999996 ms, 1678695056.6403065 bytes/s
decryption(sjcl, 250): 1173.2711080000008 ms, 5454834.7405483 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 718.831554999997 ms, 1780667516.74529 bytes/s
encryption(sjcl, 250): 1124.1934449999972 ms, 5692970.394432442 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 128(16), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 686.6170600000041 ms, 1864212345.6705143 bytes/s
decryption(sjcl, 250): 1137.8838539999997 ms, 5624475.624205492 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 50000): 782.1404850000108 ms, 1636534643.7730842 bytes/s
encryption(sjcl, 250): 1167.8130300000048 ms, 5480329.329772912 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 34144
plaintextLength: 204800(25600), keyLength: 256(32), ivLength: 128(16), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 50000): 758.4667380000028 ms, 1687615205.612346 bytes/s
decryption(sjcl, 250): 1156.292089999988 ms, 5534933.65158285 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 34136
----------------
plaintextLength: 5120000(640000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 1329.427502999999 ms, 1925640920.037444 bytes/s
encryption(sjcl, 20): 2331.1000029999996 ms, 5490969.921293421 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 853344
plaintextLength: 5120000(640000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 1331.3359990000026 ms, 1922880476.3957975 bytes/s
decryption(sjcl, 20): 2277.023132999995 ms, 5621374.59848109 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 853336
----------------
plaintextLength: 5120000(640000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 1491.867471000005 ms, 1715970117.830923 bytes/s
encryption(sjcl, 20): 2368.1725270000024 ms, 5405011.608767805 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 853344
plaintextLength: 5120000(640000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 1479.0184080000035 ms, 1730877713.3218708 bytes/s
decryption(sjcl, 20): 2411.4167549999984 ms, 5308082.882587423 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 853336
----------------
plaintextLength: 10240000(1280000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 2263.985585000002 ms, 2261498498.01274 bytes/s
encryption(sjcl, 20): 4568.631307000003 ms, 5603428.746980738 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 1706680
plaintextLength: 10240000(1280000), keyLength: 128(16), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 2196.391948999997 ms, 2331095778.3883257 bytes/s
decryption(sjcl, 20): 4549.5112910000025 ms, 5626978.012043357 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 1706668
----------------
plaintextLength: 10240000(1280000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
encryption(node, 4000): 2419.8217839999998 ms, 2115858297.4389822 bytes/s
encryption(sjcl, 20): 4745.072329000002 ms, 5395070.554255399 bytes/s
IsEncryptionResultMatching: true, ResultBase64Len: 1706680
plaintextLength: 10240000(1280000), keyLength: 256(32), ivLength: 96(12), authTagLength: 64(8), adataLength: 0(0)
decryption(node, 4000): 2433.512803000005 ms, 2103954412.6039221 bytes/s
decryption(sjcl, 20): 4722.016546999992 ms, 5421412.598874581 bytes/s
IsDecryptionResultMatching: true, ResultBase64Len: 1706668
--------base64 performance--------
dataLength: 2048(256)
encode(node, 5000): 2.032357999996748 ms, 629810299.1707407 bytes/s
decode(node, 5000): 2.1068669999949634 ms, 607537163.0022492 bytes/s
encode(sjcl, 500): 3.7247600000118837 ms, 34364630.20425252 bytes/s
decode(sjcl, 500): 4.044196000002557 ms, 31650295.880792882 bytes/s
dataLength: 204800(25600)
encode(node, 5000): 30.386588000008487 ms, 4212384753.430173 bytes/s
decode(node, 5000): 80.07266700000037 ms, 1598547978.9251857 bytes/s
encode(sjcl, 500): 205.08961900000577 ms, 62411740.10859925 bytes/s
decode(sjcl, 500): 373.9820519999921 ms, 34226241.4240143 bytes/s
dataLength: 409600(51200)
encode(node, 5000): 53.44473200000357 ms, 4789995017.656425 bytes/s
decode(node, 5000): 286.0110649999988 ms, 895070265.9003807 bytes/s
encode(sjcl, 500): 470.71661299999687 ms, 54385163.58461343 bytes/s
decode(sjcl, 500): 764.8539650000021 ms, 33470441.64175828 bytes/s
dataLength: 819200(102400)
encode(node, 5000): 463.65341500000795 ms, 1104273113.1398897 bytes/s
decode(node, 5000): 551.7035739999992 ms, 928034589.8212374 bytes/s
encode(sjcl, 500): 1333.521688000008 ms, 38394576.15180511 bytes/s
decode(sjcl, 500): 1627.7366540000075 ms, 31454719.57898158 bytes/s

Payloads

PBKDF2

node:crypto
  const startTime_node = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    let key = crypto.pbkdf2Sync(password, saltBuffer, keyIter, keySizeInBytes, digestName);
  }
  const endTime_node = performance.now();
  console.log(`pbkdf2(node, ${iterationCount}): ${endTime_node - startTime_node} ms`);
sjcl, cachedPbkdf2()
  const startTime_sjcl_cached = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    sjcl.misc.cachedPbkdf2(password, { salt: saltBitArray, iter: keyIter });
  }
  const endTime_sjcl_cached = performance.now();
  console.log(`pbkdf2(sjcl, sha256, cached, ${iterationCount}): ${endTime_sjcl_cached - startTime_sjcl_cached} ms`);
sjcl, pbkdf2()
  iterationCount /= 5; // !!!!! count changed !!!!!
  const startTime_sjcl = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    sjcl.misc.pbkdf2(password, saltBitArray, keyIter, keySizeInBits);
  }
  const endTime_sjcl = performance.now();
  console.log(`pbkdf2(sjcl, sha256, ${iterationCount}): ${endTime_sjcl - startTime_sjcl} ms`);

Encryption

node:crypto
  const startTime_node = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    cipher_node = null;
    encryptedPart_node = null;
    authTag_node = null;
    encryptedData_node = null;

    cipher_node = crypto.createCipheriv(`aes-${keyLength}-gcm` as CipherGCMTypes, key, iv, gcmOption) as CipherGCM;
    cipher_node.setAAD(adata, aadOption);
    encryptedPart_node = cipher_node.update(plaintext);
    cipher_node.final();
    authTag_node = cipher_node.getAuthTag();
    // encryptedData_node = Buffer.concat([encryptedPart_node as Buffer, authTag_node as Buffer]).toString('base64'); // this could be very slow
  }
  const endTime_node = performance.now();
  const duration_node = endTime_node - startTime_node;
  console.log(`encryption(node, ${iterationCount}): ${duration_node} ms, ${1000.0 * plaintext.byteLength * iterationCount / duration_node} bytes/s`);
sjcl
  iterationCount /= 200; // !!!!! count changed !!!!!
  const startTime_sjcl = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    cipher_sjcl = null;
    encryptedData_sjcl = null;

    cipher_sjcl = new sjcl.cipher.aes(keyBitArray);
    encryptedData_sjcl = sjcl.mode.gcm.encrypt(cipher_sjcl, plaintextBitArray, ivBitArray, adataBitArray, authTagLength);
  }
  const endTime_sjcl = performance.now();
  const duration_sjcl = endTime_sjcl - startTime_sjcl;
  console.log(`encryption(sjcl, ${iterationCount}): ${duration_sjcl} ms, ${1000.0 * plaintext.byteLength * iterationCount / duration_sjcl} bytes/s`);

Decryption

node:crypto
  const startTime_node = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    authTag_node2 = null;
    encryptedPart_node2 = null;
    decipher_node = null;
    decryptedData_node = null;

    authTag_node2 = encryptedData_node.subarray(-authTagLength / 8);
    encryptedPart_node2 = encryptedData_node.subarray(0, encryptedData_node.length - authTag_node2.length);
    decipher_node = crypto.createDecipheriv(`aes-${keyLength}-gcm` as CipherGCMTypes, key, iv, gcmOption) as DecipherGCM;
    decipher_node.setAuthTag(authTag_node2);
    decipher_node.setAAD(adata, aadOption);
    decryptedData_node = decipher_node.update(encryptedPart_node2);
    try {
      decipher_node.final();
    } catch (err) {
      throw new Error('Authentication failed! ' + err);
    }
  }
  const endTime_node = performance.now();
  const duration_node = endTime_node - startTime_node;
  console.log(`decryption(node, ${iterationCount}): ${duration_node} ms, ${1000.0 * plaintext.byteLength * iterationCount / duration_node} bytes/s`);
sjcl
  iterationCount /= 200; // !!!!! count changed !!!!!
  const startTime_sjcl = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    decipher_sjcl = null;
    decryptedData_sjcl = null;

    decipher_sjcl = new sjcl.cipher.aes(keyBitArray);
    decryptedData_sjcl = sjcl.mode.gcm.decrypt(decipher_sjcl, encryptedData_sjcl, ivBitArray, adataBitArray, authTagLength);
  }
  const endTime_sjcl = performance.now();
  const duration_sjcl = endTime_sjcl - startTime_sjcl;
  console.log(`decryption(sjcl, ${iterationCount}): ${duration_sjcl} ms, ${1000.0 * plaintext.byteLength * iterationCount / duration_sjcl} bytes/s`);

Base64

node:buffer
  let startTime_node = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    base64String = null;

    base64String = rawData.toString("base64");
  }
  let endTime_node = performance.now();
  let duration_node = endTime_node - startTime_node;
  console.log(`encode(node, ${iterationCount}): ${duration_node} ms, ${1000.0 * rawData.byteLength * iterationCount / duration_node} bytes/s`);

  startTime_node = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    rawData = null;

    rawData = Buffer.from(base64String as string, "base64");
  }
  endTime_node = performance.now();
  duration_node = endTime_node - startTime_node;
  console.log(`decode(node, ${iterationCount}): ${duration_node} ms, ${1000.0 * rawData.byteLength * iterationCount / duration_node} bytes/s`);
sjcl
  iterationCount /= 10; // !!!!! count changed !!!!!
  let startTime_sjcl = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    base64String = null;

    base64String = sjcl.codec.base64.fromBits(rawDataBitArray_sjcl);
  }
  let endTime_sjcl = performance.now();
  let duration_sjcl = endTime_sjcl - startTime_sjcl;
  console.log(`encode(sjcl, ${iterationCount}): ${duration_sjcl} ms, ${1000.0 * rawData.byteLength * iterationCount / duration_sjcl} bytes/s`);

  startTime_sjcl = performance.now();
  for (let i = 0; i < iterationCount; i++) {
    rawDataBitArray_sjcl = null;

    rawDataBitArray_sjcl = sjcl.codec.base64.toBits(base64String as string);
  }
  endTime_sjcl = performance.now();
  duration_sjcl = endTime_sjcl - startTime_sjcl;
  console.log(`decode(sjcl, ${iterationCount}): ${duration_sjcl} ms, ${1000.0 * rawData.byteLength * iterationCount / duration_sjcl} bytes/s`);

It would be nice to have a graph instead of a table with numbers.

You can use whatever tickles your fancy: gnuplot, python, spreadsheet SW, ...

3 Likes

matplotlib.pyplot.xkcd — Matplotlib 3.9.0 documentation, the obvious choice :slight_smile:

2 Likes

I tried it but I got these errors.

findfont: Font family 'xkcd Script' not found.
findfont: Font family 'Comic Neue' not found.
findfont: Font family 'xkcd' not found.

I have installed xkcd script font as this site suggested. Anyway, let's use the normal style this time.