brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: openssl speed shows how fast a machine encrypts

Openssl
~/tips/tip-openssl-speed-benchmark

openssl speed -evp aes-256-gcm

Benchmark AES and other algorithms on a NAS, Pi or VPS before you pick a cipher or VPN.

Before blaming a slow VPN or encrypted backup on the network, I like to know how much the CPU can encrypt per second. openssl speed measures it.

Test the cipher you care about through the EVP interface, which uses hardware acceleration when the CPU has it:

openssl speed -evp aes-256-gcm
openssl speed -evp chacha20-poly1305
openssl speed -seconds 1 ecdsap256 ed25519

The result is a table with throughput for block sizes from 16 bytes to 16 KB, in thousands of bytes per second. The bigger blocks are closest to bulk traffic like a file copy. The last command tests signatures per second, which matters for a server doing many TLS handshakes.

Comparing the first two lines is interesting on small boards. A CPU with AES instructions is far faster at AES-GCM, while one without them, such as older Raspberry Pi models, often does better with ChaCha20. WireGuard always uses ChaCha20, and many TLS clients pick it when they lack AES hardware.

A full run of openssl speed without arguments tests everything and takes many minutes, so name the algorithms. Use -seconds for shorter runs. The numbers are for one core by default; add -multi 4 to use four. And remember this is the ceiling of the CPU alone: disk speed, network and the software around it decide what you get in practice.

Further reading: OpenSSL: openssl-speed

More Openssl tips openssl s_client -connect 203.0.113.10:443 -servername example.com </dev/null | openssl x509 -noout -subject openssl x509 -in cert.pem -days 365 -signkey key.pem -out cert-new.pem printf %s hello | openssl dgst -sha256 -hmac secret openssl pkcs12 -legacy -in old.pfx -nokeys echo 'aGVsbG8gd29ybGQ=' | openssl base64 -d All Openssl tips (34) All topics

Link