Alex Gleason 🐍🚬 on Nostr: nip04 encrypt: 5,000 iter/s aes-cbc without a shared secret encrypt: 40,000 iter/s ...
nip04 encrypt: 5,000 iter/s
aes-cbc without a shared secret encrypt: 40,000 iter/s
aes-gcm and nip44 basically the same.
The point is if you're encrypting a message to only yourself, it's 10x faster to not do this diffie-hellman thing and just BYO secret.
Please note that I don't actually understand all these words, I just ran a few benchmarks, and decided to encrypt secrets in my database with aes-gcm and just one key instead of nip44/nip04.
Published at
2024-10-03 15:24:07Event JSON
{
"id": "b872325ba37f4b59f0f3861f600be267efe8f30132bbfda04d7fb0913eeeb0e0",
"pubkey": "0461fcbecc4c3374439932d6b8f11269ccdb7cc973ad7a50ae362db135a474dd",
"created_at": 1727969047,
"kind": 1,
"tags": [],
"content": "nip04 encrypt: 5,000 iter/s\n\naes-cbc without a shared secret encrypt: 40,000 iter/s\n\naes-gcm and nip44 basically the same.\n\nThe point is if you're encrypting a message to only yourself, it's 10x faster to not do this diffie-hellman thing and just BYO secret.\n\nPlease note that I don't actually understand all these words, I just ran a few benchmarks, and decided to encrypt secrets in my database with aes-gcm and just one key instead of nip44/nip04.\n\n",
"sig": "14f5e182ba7198f96d8a69fc8ff230a770037b976ce88eb7826a4c10ce07e9548667d79a77bf1b6baf00397cf466653485ab48cee9b5eaff7fdf9d2764addc35"
}