LocalExcelTool
はじめる

RSA鍵ペア生成

RSA-OAEP 2048/3072/4096 ビットの公開鍵・秘密鍵をブラウザ内で生成。

RSA鍵ペア生成とは

RSA鍵ペア生成ツールは、ブラウザの Web Crypto API で RSA-OAEP 方式の公開鍵・秘密鍵ペアを生成します。鍵長は 2048・3072・4096 ビットから選択でき、出力は標準的な PEM 形式です。鍵はブラウザ内で生成され、秘密鍵がサーバーへ送信されることはありません。

🔒 処理はすべてブラウザ内で完結し、データは送信されません。

このツールの前提

処理場所
このページのブラウザ内(JavaScript / Canvas)
アップロード
なし — ファイルは端末の外に出ません
オフライン
ページを開いた後は通信不要

Generated in the tab, and that has consequences

The pair is produced by crypto.subtle.generateKey with RSA-OAEP and SHA-256, public exponent 65537 — the standard interoperable choice. The private key exists only in this tab's memory. Nothing is stored, nothing is recoverable, and a refresh destroys it. Copy it before doing anything else.

That ephemerality is a feature for a demo and a hazard for real use. A production key pair should be generated where it will live — an HSM, a KMS, or at minimum a machine with disk encryption — because a lost private key cannot be regenerated, only replaced along with everything that trusts it.

RSA-OAEP encrypts; it does not sign

The algorithm identifier determines the permitted operations. OAEP is a padding scheme for encryption and key transport; asking the same key to sign produces an error in Web Crypto. Signing needs RSASSA-PKCS1-v1_5 or RSA-PSS, which are separate algorithm names and separate key usages.

This trips people up because the key material looks identical. A key imported as 'RSA-OAEP' will refuse sign operations, and the error message usually mentions the algorithm rather than the usage — so the fix is to regenerate with the intended algorithm, not to retry.

Reading the exported formats

The export is PEM-wrapped: PKCS#8 for the private key, SubjectPublicKeyInfo (SPKI) for the public key, both standard and accepted by OpenSSL, Node and every cloud KMS import flow. The base64 body is the DER structure, wrapped at 64 characters.

Key size is the practical parameter: 2048 bits is the minimum still accepted everywhere, 3072 and 4096 are safer and slower. The real cost of RSA is that encryption is limited to a payload smaller than the modulus minus padding overhead — roughly 190 bytes at 2048 bits for OAEP-SHA256. Anything longer must be encrypted with a symmetric key that RSA then wraps, which is what every real protocol does.

使い方

  1. 1.鍵長を選択
  2. 2.実行をクリック
  3. 3.公開鍵と秘密鍵をそれぞれ保存

他の方法との比較

同じ変換をする方法は 3 つあります。ブラウザ内(このページ)、サーバー側の変換サービス、デスクトップアプリ。差がつくのは速度ではなく、ファイルがどこへ行くかと、無料でどこまでできるかです。

観点このツールサーバー側の変換サービス
ファイルの処理場所このページのブラウザ内ベンダーのサーバー(アップロード後)
アカウント不要多くの場合必要(無料枠の制限解除に登録を求める)
無料で扱えるサイズサイズ制限なし(回数制限もなし)数ファイル/時間、または 5〜10MB 程度で課金 wall
料金無料。Pro は月 $9(大きいファイルと AI 機能のみ)サブスクが一般的。おおむね月 $7〜15(2026 年 11 月時点)
オフライン一度開けば通信不要不可
20MB を処理し始めるまで待ち時間なし(アップロードが無い)アップロードが支配的(10Mbps 上りで約 16 秒)
保証できないこと出力は決定的です。他の実装と突き合わせて検証できます同じ(変換の原理は変わらない)

サーバー側のサービスが優れている点は明確にあります。巨大なファイル、チームでの共有、変換履歴の管理、スクリプトからの自動化。逆に「1 回だけ、手元のファイルを別形式にしたい」という今回の用途では、アップロードの待ち時間と登録の手間だけが増えます。

よくある質問

秘密鍵は安全?

はい。Web Crypto でブラウザ内生成され、秘密鍵がどこにも送信されません。ただしタブを閉じると消えるため、その場でコピーしてください。

鍵長はどれを選ぶ?

一般用途は 2048 ビット、長期運用や高セキュリティ要件では 3072 / 4096 ビットを推奨します。

この変換で失われるもの

エンコードとハッシュは Web Crypto API または純 JavaScript 実装で行います。出力は決定的で、同じ入力からは常に同じ結果になります。他のツールと突き合わせて検証できます。

その他のエンコード / デコード