← 返回命令列表

Linux command

openssl-speed 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Run all default benchmarks

openssl speed

Benchmark a specific algorithm

openssl speed [aes-256-cbc]

Benchmark multiple algorithms

openssl speed [sha256] [sha512] [aes-128-gcm]

Benchmark using the EVP interface

openssl speed -evp [aes-256-gcm]

Run benchmarks for a specific duration

openssl speed -seconds [10] [rsa2048]

Run benchmarks with specific buffer sizes

openssl speed -bytes [8192] [aes-256-cbc]

Use multiple parallel operations

openssl speed -multi [4] [sha256]

Output results in machine-readable format

openssl speed -mr [aes-256-cbc]

说明

openssl speed tests the performance of cryptographic algorithms by running repeated operations and measuring throughput. It reports operations per second for public-key algorithms and bytes per second for symmetric ciphers and hashes, testing across multiple buffer sizes (16, 64, 256, 1024, 8192, and 16384 bytes). When run without arguments, it benchmarks a pre-compiled selection of common algorithms including AES, SHA, RSA, and elliptic curves. Specific algorithms can be selected as arguments, and the -evp flag allows testing any algorithm available through OpenSSL's EVP interface. Results help identify the most efficient algorithms for a given system and can reveal hardware acceleration benefits (e.g., AES-NI instructions).

参数

-help
Display usage information and exit.
-elapsed
Use wall-clock time instead of CPU user time when calculating throughput.
-evp _algo_
Use the specified cipher or message digest algorithm via the EVP interface. Required for testing algorithms not in the pre-compiled list.
-hmac _digest_
Benchmark HMAC using the specified message digest.
-cmac _cipher_
Benchmark CMAC using the specified cipher.
-multi _num_
Run _num_ parallel benchmarks simultaneously.
-async_jobs _num_
Activate asynchronous mode and start the specified number of jobs.
-misalign _num_
Offset test buffers by _num_ bytes to test misaligned access performance.
-decrypt
Measure decryption instead of encryption (EVP testing only).
-mb
Enable multi-block mode for EVP ciphers that support it.
-aead
Benchmark an AEAD cipher in a TLS-like sequence.
-primes _num_
Generate a multi-prime RSA key with _num_ primes (RSA testing only).
-seconds _num_
Run each benchmark for _num_ seconds instead of the default 3.
-bytes _num_
Run benchmarks on buffers of _num_ bytes.
-mr
Output results in a machine-readable format.
-rand _files_
Specify files to seed the random number generator.
-writerand _file_
Write random data to the specified file on exit.
-engine _id_
Select an engine by ID (deprecated in OpenSSL 3.0).
-provider _name_
Load and use the specified provider.

FAQ

What is the openssl-speed command used for?

openssl speed tests the performance of cryptographic algorithms by running repeated operations and measuring throughput. It reports operations per second for public-key algorithms and bytes per second for symmetric ciphers and hashes, testing across multiple buffer sizes (16, 64, 256, 1024, 8192, and 16384 bytes). When run without arguments, it benchmarks a pre-compiled selection of common algorithms including AES, SHA, RSA, and elliptic curves. Specific algorithms can be selected as arguments, and the -evp flag allows testing any algorithm available through OpenSSL's EVP interface. Results help identify the most efficient algorithms for a given system and can reveal hardware acceleration benefits (e.g., AES-NI instructions).

How do I run a basic openssl-speed example?

Run `openssl speed` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -help do in openssl-speed?

Display usage information and exit.