Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
SJCL sym vs asym
(version: 0)
Comparing performance of:
asym vs sym
Created:
8 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.rawgit.com/alanhoff/node-sjcl-all/master/sjcl.js"></script>
Script Preparation code:
var keys = sjcl.ecc.elGamal.generateKeys(256, 6); var pub = keys.pub, sec = keys.sec; var sym = keys.sec.get(); var msg = '{"iv":"Q1KnYbhlZs56EzrL/H2KAA==","v":1,"iter":10000,"ks":128,"ts":64,"mode":"ccm","adata":"","cipher":"aes","salt":"WntEmrUQudA=","ct":"V8hXjI1Ed7hPhjON9PKfNNIWyGZ93d8jb/svMRa75PDyB4gJ29BnJ2c5wgFXtBJ7rxsCaq2E/mu8cKWxyl/NqfhCPd004nJj/S3jqYLbjFU27JcDhMmCZ5n3m1lY3oH0OQN6f/eHA2pInlyDtf2FYKLeU8xhCN+rsUKXzTwTX+ns5l+3uWTVqDBE/sW+wPBeBw4g3qTotrCdJohxCmN1qitMICIOT0nUaD/M2wIY1x8rkf9IF/buv+HpUTqOjBSeo6fdZBcP++lhH29FDM3RIjtMm2byC5xPp4iFaGB9ibXxMePSSoioY1ryOoUzaia5Tr3Z0mervats00jFkfQRIhUDb011nJ6JFQHDpQ2qxmAxOXHHkNBRY4eNwY3hHrd2ERB99H0gsPRZ6iOdg8scryhCncnHcz5wuIRu3IGMPpTP5clwlDOvIrvgyaj9XvZsuxshNcsrU3RVTgbMZfJklcb+EfDx1Siv6aq5zTU+dHVlw/MEJ44ljC1s0s+UjWIAQjusbpdbbZc0VG9Xs25rWIdz2al1k8rteCkUNRck8HLTP5sTvR5LILLqJONBYgExhGSwIaMPRbjWSpB9dPPUZBfD/kEzHwX4MrwpKzKHVV9aY0wLH7jQ16P//IeyTgN8zVAVTiLJFn3Fn2R/TaIavq4GSCThno4YRaP1ALs18AMSjbIm3eLRGN59Gb18sFKwtDQX3tiNDIiNaXnl5XrgY//MJLrMBpPPZ9a0JTphVrS6HySa2G7D+gaXXEk5y8tFxv4rQ/Ka0L2cFFHJXP2DH0RP4B60AAEv7xhvgfY7O6scTlEFis21Cu/dJapSIdlT2xBomym4eyYGkSfgRZJcKQVG+b1H394GSEVYObYni42SQkcRPqaq8oVSEUHOviMhjLYivMoTqp3pXpEQeQC0N/7s9+1RFHmH+0WZc4QJ7/5i4U8kqfXsmr3nFzMjaro3VdJbMVOP6GkWZMJS6CppgZCrns27KxNZJUDvRNL22oGpzTYUFLIHog3gHxFbEUYUMUG455f//dKxYwThARnpj1GeaUW7dFyaKAyBbZQMXyRy6a6sMwwj7w/JZ3t2AEvkyD1WRqKu62zIDIknRZp6Qk6lec5/I4iP/PCYCxh4jnDohBNXUVHwQujxo76zk1QI2OljquCz2QNHSp7M7LORmGXAcSP172EogGN2/JoQDw98w0WhjJ5/iBonTL5scsFCmsgX5eLsjWPvBw8OVh9TjVPE8wRkqBDDAOnSXxvRl5faEJ940B/LzEANQcXrDlVckBWOX8YQ4kVm2DF1kXsKweBrejwSiYRTs22GTXLRygSVM2r9eKQPnR2HU4xY2tSB4mjEoLft2eVJV0m9jqyn+uN9lLtrbnV1ynItmI0mofV1lJ4B9QIkbzgs"}';
Tests:
asym
sec, sjcl.encrypt(pub, msg)
sym
sym, sjcl.encrypt(sym, msg)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
asym
sym
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
Let's break down the provided JSON data to understand what is being tested and the pros/cons of different approaches. **Benchmark Definition** The benchmark definition is the script that runs on each execution. In this case, there are two test cases: 1. `sec, sjcl.encrypt(pub, msg)`: This test case compares the performance of using a public key (`pub`) for encryption with the symmetric encryption method (`sym`). 2. `sym, sjcl.encrypt(sym, msg)`: This test case compares the performance of using symmetric encryption with the public key. **Public Key vs Symmetric Encryption** The `sjcl.ecc.elGamal.generateKeys(256, 6)` function generates a pair of public and private keys for asymmetric (public key) encryption. The `get()` method returns the public key as an object that can be used directly in encryption operations. The symmetric encryption method (`sym`) uses a shared secret key to encrypt and decrypt data. In this case, the `sjcl.encrypt(sym, msg)` function takes the shared secret key (`sym`) and the message (`msg`) as input. **Options Compared** Here are some options compared: 1. **Asymmetric (Public Key) vs Symmetric Encryption**: The first test case compares the performance of using public keys for encryption versus symmetric encryption. 2. **Symmetric Encryption with Public Key**: The second test case compares the performance of using a shared secret key (`sym`) that is derived from the public key. **Pros and Cons** Here are some pros and cons of each approach: 1. **Asymmetric (Public Key) vs Symmetric Encryption**: * Pros: More secure, as it uses a unique key for encryption and decryption. * Cons: Typically slower than symmetric encryption methods. 2. **Symmetric Encryption with Public Key**: * Pros: Faster than asymmetric encryption methods. * Cons: Less secure, as the shared secret key is derived from the public key. **Latest Benchmark Results** The latest benchmark results show that: 1. Symmetric encryption (`sym`) outperforms asymmetric encryption for small messages (i.e., `msg`). 2. Asymmetric encryption (`sec`) performs better than symmetric encryption for larger messages or in scenarios where security is more critical. Keep in mind that these results are specific to the test cases and may not be representative of all use cases.
Related benchmarks:
SJCL sym vs asym
Lodash CloneDeep vs Native spread - LARGE key set
window.atob benchmark
sha256-js twin
Comments
Confirm delete:
Do you really want to delete benchmark?