環境
OpenSSLのspeedコマンドで調査。
https://www.openssl.org/docs/man1.1.1/man1/openssl-speed.html
PCスペック
Intel(R) Celeron(R) N5095 @ 2.00GHz 2.00 GHz
実装RAM:16.0 GB
Windows 11 Pro
方法
Windowsのコマンドプロンプトに入力した調査コマンド。
echo ------RSA------ >>C:\temp\keygen-time.txt
echo Start RSA2048 >>C:\temp\keygen-time.txt
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
openssl genrsa 2048 > cert2048.key
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
echo Start RSA3072 >>C:\temp\keygen-time.txt
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
openssl genrsa 3072 > cert3072.key
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
echo Start RSA4096 >>C:\temp\keygen-time.txt
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
openssl genrsa 4096 > cert4096.key
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
echo Start RSA7680 >>C:\temp\keygen-time.txt
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
openssl genrsa 7680 > cert7680.key
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
echo Start RSA15360 >>C:\temp\keygen-time.txt
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
openssl genrsa 15360 > cert15360.key
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
echo ------ECC------ >>C:\temp\keygen-time.txt
echo Start P-256 >>C:\temp\keygen-time.txt
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
openssl ecparam -name prime256v1 -genkey -out certprime256v1.key
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
echo Start P-384 >>C:\temp\keygen-time.txt
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
openssl ecparam -name secp384r1 -genkey -out certecc384.key
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
echo Start P-521 >>C:\temp\keygen-time.txt
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
openssl ecparam -name secp521r1 -genkey -out certecc521.key
echo %DATE% %TIME% >>C:\temp\keygen-time.txt
exit
結果
------RSA------
Start RSA2048
2023/01/21 6:01:58.40
2023/01/21 6:01:58.68
Start RSA3072
2023/01/21 6:01:58.69
2023/01/21 6:01:59.21
Start RSA4096
2023/01/21 6:01:59.23
2023/01/21 6:02:03.35
Start RSA7680
2023/01/21 6:02:03.36
2023/01/21 6:02:24.90
Start RSA15360
2023/01/21 6:02:24.91
2023/01/21 6:06:22.68
------ECC------
Start P-256
2023/01/21 6:06:22.70
2023/01/21 6:06:22.74
Start P-384
2023/01/21 6:06:22.76
2023/01/21 6:06:22.80
Start P-521
2023/01/21 6:06:22.81
2023/01/21 6:06:22.86
調査結果
RSA3072bits以下は、1秒未満で鍵ペア生成できていたが、RSA4096bitsは3秒、RSA7360bitsは36秒、RSA15360bitsは3分15秒かかっており、RSA4096bits以下が実用的な範囲内であると考えられる。
一方、ECDSA 256 bits~521bitsは、いずれも、0.04~0.05秒とすべて実用的な範囲内だと考えられる。
暗号アルゴリズム cryptographic algorithms | 1回目 鍵ペア 生成時間(秒) | 2回目 鍵ペア 生成時間(秒) | 3回目 鍵ペア 生成時間(秒) | 平均 鍵ペア 生成時間(秒) |
RSA 2048 bits | 0.28 | 0.87 | 0.67 | 0.61 |
RSA 3072 bits | 0.52 | 0.61 | 1.15 | 0.76 |
RSA 4096 bits | 4.12 | 3.34 | 2.47 | 3.31 |
RSA 7360 bits | 21.54 | 1:01.51 | 26.17 | 36.41 |
RSA 15360 bits | 3:57.77 | 2:47.71 | 3:00.21 | 3:15.23 |
ECDSA 256 bits | 0.04 | 0.04 | 0.05 | 0.04 |
ECDSA 384 bits | 0.04 | 0.04 | 0.04 | 0.04 |
ECDSA 521 bits | 0.05 | 0.05 | 0.05 | 0.05 |