SlideShare a Scribd company logo
1 of 12
Download to read offline
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
実験数学 3
(大阪大学理学部数学科 3 年・4 年)
第 1 回: RSA 暗号
鈴木 譲
2013 年 4 月 11 日
1 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
概要
1 はじめに
2 ユークリッド互除法
3 RSA 暗号
4 安全性の根拠
5 暗号化の高速化
2 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
公開鍵暗号
送信側 受信側
m
平文
-暗号化
f c := f (m)
暗号文
- 送信 -· · · - 受信 -
c
暗号文
復号化
f −1
-
m := f −1(c)
平文
共通鍵暗号と公開鍵暗号
共通鍵暗号 (戦争)  暗号化 f : 秘密, 復号化 f −1: 秘密
公開鍵暗号 (インターネット)  暗号化 f : 公開, 復号化 f −1: 秘密
知らない相手に、暗号化 f をすぐに教える
f ↔ f −1
であっても、f → f −1
の計算が膨大
 
RSA 暗号: Rivest, Shamir, Adleman (1976): 公開鍵暗号の 1 種
3 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
ユークリッド互除法
Z: 整数全体
a, b, c ∈ Z, a ≥ 0, b > 0
. 1 b|a
def
⇐⇒ k ∈ Z s.t. bk = a
.
2 a mod b = c
def
⇐⇒
{
b|(a − c)
0 ≤ c ≤ b − 1
.
3 (a, b): a, b の最大公約数 > 0
b|a =⇒ (a, b) = b
a modb = c =⇒
{
(a, b)|c
(b, c)|a
=⇒
{
(a, b)|(b, c)
(b, c)|(a, b)
=⇒ (a, b) = (b, c)
{ai }n
i=1 :
{
a1 ≥ 0, a2 > 0, an|an−1
ai mod ai+1 = ai+2 > 0, i = 1, · · · , n − 2
=⇒ (a1, a2) = · · · = (an−1, an) = an
4 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
a ≥ 0, b > 0 =⇒ ∃x, y ∈ Z s.t. ax + by = (a, b)
{ai }n
i=1, {xi }n
i=1, {yi }n
i=1 を以下で定義:
a1 := a, a2 := b, x1 := 1, y1 := 0, x2 := 0, y2 := 1
ax1 + by1 = a1 (1)
ax2 + by2 = a2 (2)
a3 := a1 mod a2, q :=
a1 − a3
a2
, x3 := x1 − qx2, y3 := y1 − qy2
ax3 + by3 = a3 (3)
これをくりかえすと、
axn + byn = an = (a, b)
5 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
a ≡ c (mod b)
def
⇐⇒ b|(a − c)
a1 ≡ c1, a2 ≡ c2 (mod b) =⇒ a1 + a2 ≡ c1 + c2 (mod b)
a1 ≡ c1, a2 ≡ c2 (mod b) =⇒ a1a2 ≡ c1c2 (mod b)
a ≥ 0, b > 0, (a, b) = 1 =⇒ ∃x ∈ Z s.t.ax ≡ 1(mod b)
.
(a, b) = 1 であれば、ax + by = 1 なる x, y ∈ Z が存在するから
6 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
RSA 暗号: 鍵生成
公開鍵 (n, e) と秘密鍵 d の生成
.
.
.
各自が、公開鍵 (n, e) を公開、秘密鍵 d を秘密に
.
1 素数 p ̸= q を選ぶ
.
2 n := pq, ϕ := (p − 1)(q − 1)
.
3 (e, ϕ) = 1 なる e (mod ϕ) を選ぶ (1 ≤ e ≤ ϕ − 1)
.
4 ex ≡ 1 (mod ϕ) なる x = d を選ぶ (1 ≤ d ≤ ϕ − 1)
ed ≡ ed′
≡ 1 (mod ϕ) =⇒ e(d − d′
) ≡ 0 (mod ϕ)
=⇒ d − d′
≡ 0 (mod ϕ)
k ∈ Z, ed ≡ 1 (mod ϕ) =⇒ e(d + kϕ) ≡ 1 (mod ϕ)
7 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
RSA 暗号: 暗号化と復号化
平文 m ∈ [0, n − 1] を暗号化して、c := me mod n
.
.
.
送信側は、受信側の公開鍵 (n, e) で平文 m を暗号化
長ければ、短いブロックに区切り、それぞれを n 通りの平文
送信側 受信側
m
-暗号化
c := me
mod n- 送信 -· · · - 受信 -
c
復号化 -
m = cd
mod n
(me
)d
≡ m (mod n)
仮定: (n, e) → d の計算が膨大で、d はわからない
8 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
Fermat の小定理: p: 素数, m ∈ Z (m ≥ 0)
(m, p) = 1 =⇒ mp−1
≡ 1 (mod p)
1 ≤ k ≤ p − 1 =⇒



k!
(
p
k
)
=
∏p
j=p−k+1 j ≡ 0 (mod p)
k! ̸≡ 0 (mod p)
=⇒
(
p
k
)
≡ 0 (mod p)
(a1 + a2)p
− (ap
1 + ap
2) =
p−1∑
k=1
(
p
k
)
ak
1ap−k
2 ≡ 0 (mod p)
数学的帰納法で一般の m に拡張し、a1 = · · · = am = 1 とおくと
(1 + · · · + 1
m
)p
− (1p
+ · · · + 1p
m
) ≡ 0 (mod p)
m(mp−1
− 1) ≡ 0 (mod p)
9 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
med
≡ m (mod n)
ed ≡ 1 (mod ϕ) より、ed = 1 + kϕ なる整数 k が存在.
1 (m, p) = 1 であれば、Fermat の小定理から
mp−1
≡ 1 (mod p)
m1+kϕ
= m1+k(p−1)(q−1)
= m · (mp−1
)k(q−1)
≡ m (mod p)
med
≡ m (mod p) (4)
.
2 (m, p) = p でも (4) は成立
p, q を入れ替えても (4) は成立する。
med
≡ m (mod q)
p ̸= q より、(p, q) = 1 であるので、
med
≡ m (mod pq)
10 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
安全性の根拠
RSA 暗号の安全性
.
.
.
(n, e) → d は数学的に一意だが、計算量が膨大
商用の n は、n = 21024, 22048 程度
=⇒ 最速の計算機でも素因数分解に 10 年かかる
 
RSA 暗号を破るには
計算機で n = pq と因数分解できる
=⇒ ϕ = (p − 1)(q − 1) が求まる
=⇒ e の値とユークリッド互除法で d が求まる
大きな数 n の素因数分解
大きな数 n のオイラー数 ϕ の計算
現在の計算機で素因数分解が難しいことが、安全性の根拠
11 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
参考: me
mod n の高速化
再帰的に計算して、e ではなく、log2 e に比例する程度の計算
me
mod n =



(me/2 mod )2 mod n (e : even, e ̸= 0)
m · (m(e−1)/2 mod n)2 mod n (e : odd)
1 (e = 0)
12 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号

More Related Content

What's hot

04.第四章用Matlab求偏导数
04.第四章用Matlab求偏导数04.第四章用Matlab求偏导数
04.第四章用Matlab求偏导数Xin Zheng
 
行列補完を用いた無線マルチキャスト符号構成アルゴリズム
行列補完を用いた無線マルチキャスト符号構成アルゴリズム行列補完を用いた無線マルチキャスト符号構成アルゴリズム
行列補完を用いた無線マルチキャスト符号構成アルゴリズムTasuku Soma
 
アルゴリズムイントロダクション15章 動的計画法
アルゴリズムイントロダクション15章 動的計画法アルゴリズムイントロダクション15章 動的計画法
アルゴリズムイントロダクション15章 動的計画法nitoyon
 
CODE FESTIVAL 2015 予選B 解説
CODE FESTIVAL 2015 予選B 解説CODE FESTIVAL 2015 予選B 解説
CODE FESTIVAL 2015 予選B 解説AtCoder Inc.
 
情報オリンピック夏合宿発表
情報オリンピック夏合宿発表情報オリンピック夏合宿発表
情報オリンピック夏合宿発表Kazuma Mikami
 
RUPC2014_Day2_K
RUPC2014_Day2_KRUPC2014_Day2_K
RUPC2014_Day2_Ks1190048
 
Sanpo
SanpoSanpo
Sanpooupc
 
公開鍵暗号2: NP困難性
公開鍵暗号2: NP困難性公開鍵暗号2: NP困難性
公開鍵暗号2: NP困難性Joe Suzuki
 
日曜数学会_ガロア体上の符号とQRコード_Kuma
日曜数学会_ガロア体上の符号とQRコード_Kuma日曜数学会_ガロア体上の符号とQRコード_Kuma
日曜数学会_ガロア体上の符号とQRコード_KumaNotoriShannonlover
 
【展開用】日曜数学会 Sinc関数の積分について
【展開用】日曜数学会 Sinc関数の積分について【展開用】日曜数学会 Sinc関数の積分について
【展開用】日曜数学会 Sinc関数の積分について和人 桐ケ谷
 
pre: 数列で学ぶ初めての CommonLisp #fibonacci
pre: 数列で学ぶ初めての CommonLisp #fibonaccipre: 数列で学ぶ初めての CommonLisp #fibonacci
pre: 数列で学ぶ初めての CommonLisp #fibonaccipgf2alpha
 
最小カットを使って「燃やす埋める問題」を解く
最小カットを使って「燃やす埋める問題」を解く最小カットを使って「燃やす埋める問題」を解く
最小カットを使って「燃やす埋める問題」を解くshindannin
 
数列で学ぶ初めての CommonLisp #fibonacci
数列で学ぶ初めての CommonLisp #fibonacci数列で学ぶ初めての CommonLisp #fibonacci
数列で学ぶ初めての CommonLisp #fibonaccipgf2alpha
 
トーラスと平面の部分集合のホモロジー
トーラスと平面の部分集合のホモロジートーラスと平面の部分集合のホモロジー
トーラスと平面の部分集合のホモロジー政孝 鍋島
 
Gcd
GcdGcd
Gcdoupc
 
Infinite SVM - ICML 2011 読み会
Infinite SVM - ICML 2011 読み会Infinite SVM - ICML 2011 読み会
Infinite SVM - ICML 2011 読み会Shuyo Nakatani
 

What's hot (20)

04.第四章用Matlab求偏导数
04.第四章用Matlab求偏导数04.第四章用Matlab求偏导数
04.第四章用Matlab求偏导数
 
行列補完を用いた無線マルチキャスト符号構成アルゴリズム
行列補完を用いた無線マルチキャスト符号構成アルゴリズム行列補完を用いた無線マルチキャスト符号構成アルゴリズム
行列補完を用いた無線マルチキャスト符号構成アルゴリズム
 
アルゴリズムイントロダクション15章 動的計画法
アルゴリズムイントロダクション15章 動的計画法アルゴリズムイントロダクション15章 動的計画法
アルゴリズムイントロダクション15章 動的計画法
 
動的計画法
動的計画法動的計画法
動的計画法
 
CODE FESTIVAL 2015 予選B 解説
CODE FESTIVAL 2015 予選B 解説CODE FESTIVAL 2015 予選B 解説
CODE FESTIVAL 2015 予選B 解説
 
情報オリンピック夏合宿発表
情報オリンピック夏合宿発表情報オリンピック夏合宿発表
情報オリンピック夏合宿発表
 
RUPC2014_Day2_K
RUPC2014_Day2_KRUPC2014_Day2_K
RUPC2014_Day2_K
 
Sanpo
SanpoSanpo
Sanpo
 
公開鍵暗号2: NP困難性
公開鍵暗号2: NP困難性公開鍵暗号2: NP困難性
公開鍵暗号2: NP困難性
 
Convex Hull Trick
Convex Hull TrickConvex Hull Trick
Convex Hull Trick
 
会津合宿2015Day3:D問題
会津合宿2015Day3:D問題会津合宿2015Day3:D問題
会津合宿2015Day3:D問題
 
日曜数学会_ガロア体上の符号とQRコード_Kuma
日曜数学会_ガロア体上の符号とQRコード_Kuma日曜数学会_ガロア体上の符号とQRコード_Kuma
日曜数学会_ガロア体上の符号とQRコード_Kuma
 
【展開用】日曜数学会 Sinc関数の積分について
【展開用】日曜数学会 Sinc関数の積分について【展開用】日曜数学会 Sinc関数の積分について
【展開用】日曜数学会 Sinc関数の積分について
 
pre: 数列で学ぶ初めての CommonLisp #fibonacci
pre: 数列で学ぶ初めての CommonLisp #fibonaccipre: 数列で学ぶ初めての CommonLisp #fibonacci
pre: 数列で学ぶ初めての CommonLisp #fibonacci
 
最小カットを使って「燃やす埋める問題」を解く
最小カットを使って「燃やす埋める問題」を解く最小カットを使って「燃やす埋める問題」を解く
最小カットを使って「燃やす埋める問題」を解く
 
数列で学ぶ初めての CommonLisp #fibonacci
数列で学ぶ初めての CommonLisp #fibonacci数列で学ぶ初めての CommonLisp #fibonacci
数列で学ぶ初めての CommonLisp #fibonacci
 
トーラスと平面の部分集合のホモロジー
トーラスと平面の部分集合のホモロジートーラスと平面の部分集合のホモロジー
トーラスと平面の部分集合のホモロジー
 
ガウス積分の問題
ガウス積分の問題ガウス積分の問題
ガウス積分の問題
 
Gcd
GcdGcd
Gcd
 
Infinite SVM - ICML 2011 読み会
Infinite SVM - ICML 2011 読み会Infinite SVM - ICML 2011 読み会
Infinite SVM - ICML 2011 読み会
 

Similar to 公開鍵暗号1: RSA暗号

公開鍵暗号(6): ナップザック暗号
公開鍵暗号(6): ナップザック暗号公開鍵暗号(6): ナップザック暗号
公開鍵暗号(6): ナップザック暗号Joe Suzuki
 
Shunsuke Horii
Shunsuke HoriiShunsuke Horii
Shunsuke HoriiSuurist
 
公開鍵暗号3: ナップザック暗号
公開鍵暗号3: ナップザック暗号公開鍵暗号3: ナップザック暗号
公開鍵暗号3: ナップザック暗号Joe Suzuki
 
Deep learning _linear_algebra___probablity___information
Deep learning _linear_algebra___probablity___informationDeep learning _linear_algebra___probablity___information
Deep learning _linear_algebra___probablity___informationtakutori
 
RSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpRSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpsonickun
 
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2東京都市大学 データ解析入門 7 回帰分析とモデル選択 2
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2hirokazutanaka
 
深層学習と確率プログラミングを融合したEdwardについて
深層学習と確率プログラミングを融合したEdwardについて深層学習と確率プログラミングを融合したEdwardについて
深層学習と確率プログラミングを融合したEdwardについてryosuke-kojima
 
topology of musical data
topology of musical datatopology of musical data
topology of musical dataTatsuki SHIMIZU
 
代数的実数とCADの実装紹介
代数的実数とCADの実装紹介代数的実数とCADの実装紹介
代数的実数とCADの実装紹介Masahiro Sakai
 
Sparse pca via bipartite matching
Sparse pca via bipartite matchingSparse pca via bipartite matching
Sparse pca via bipartite matchingKimikazu Kato
 
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃trmr
 
パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化Miyoshi Yuya
 
JOIss2020 発表資料
JOIss2020 発表資料JOIss2020 発表資料
JOIss2020 発表資料mdkcpp 1015
 
Rで計量時系列分析~CRANパッケージ総ざらい~
Rで計量時系列分析~CRANパッケージ総ざらい~ Rで計量時系列分析~CRANパッケージ総ざらい~
Rで計量時系列分析~CRANパッケージ総ざらい~ Takashi J OZAKI
 
確率微分方程式の導出(仮)
確率微分方程式の導出(仮)確率微分方程式の導出(仮)
確率微分方程式の導出(仮)HanpenRobot
 
Provable Security1
Provable Security1Provable Security1
Provable Security1Satoshi Hada
 

Similar to 公開鍵暗号1: RSA暗号 (20)

公開鍵暗号(6): ナップザック暗号
公開鍵暗号(6): ナップザック暗号公開鍵暗号(6): ナップザック暗号
公開鍵暗号(6): ナップザック暗号
 
Shunsuke Horii
Shunsuke HoriiShunsuke Horii
Shunsuke Horii
 
公開鍵暗号3: ナップザック暗号
公開鍵暗号3: ナップザック暗号公開鍵暗号3: ナップザック暗号
公開鍵暗号3: ナップザック暗号
 
Deep learning _linear_algebra___probablity___information
Deep learning _linear_algebra___probablity___informationDeep learning _linear_algebra___probablity___information
Deep learning _linear_algebra___probablity___information
 
RSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpRSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjp
 
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2東京都市大学 データ解析入門 7 回帰分析とモデル選択 2
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2
 
NLPforml5
NLPforml5NLPforml5
NLPforml5
 
Prml sec6
Prml sec6Prml sec6
Prml sec6
 
深層学習と確率プログラミングを融合したEdwardについて
深層学習と確率プログラミングを融合したEdwardについて深層学習と確率プログラミングを融合したEdwardについて
深層学習と確率プログラミングを融合したEdwardについて
 
topology of musical data
topology of musical datatopology of musical data
topology of musical data
 
代数的実数とCADの実装紹介
代数的実数とCADの実装紹介代数的実数とCADの実装紹介
代数的実数とCADの実装紹介
 
Sparse pca via bipartite matching
Sparse pca via bipartite matchingSparse pca via bipartite matching
Sparse pca via bipartite matching
 
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃
 
パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化
 
6 Info Theory
6 Info Theory6 Info Theory
6 Info Theory
 
JOIss2020 発表資料
JOIss2020 発表資料JOIss2020 発表資料
JOIss2020 発表資料
 
Rで計量時系列分析~CRANパッケージ総ざらい~
Rで計量時系列分析~CRANパッケージ総ざらい~ Rで計量時系列分析~CRANパッケージ総ざらい~
Rで計量時系列分析~CRANパッケージ総ざらい~
 
ndwave3.pdf
ndwave3.pdfndwave3.pdf
ndwave3.pdf
 
確率微分方程式の導出(仮)
確率微分方程式の導出(仮)確率微分方程式の導出(仮)
確率微分方程式の導出(仮)
 
Provable Security1
Provable Security1Provable Security1
Provable Security1
 

More from Joe Suzuki

RとPythonを比較する
RとPythonを比較するRとPythonを比較する
RとPythonを比較するJoe Suzuki
 
R集会@統数研
R集会@統数研R集会@統数研
R集会@統数研Joe Suzuki
 
E-learning Development of Statistics and in Duex: Practical Approaches and Th...
E-learning Development of Statistics and in Duex: Practical Approaches and Th...E-learning Development of Statistics and in Duex: Practical Approaches and Th...
E-learning Development of Statistics and in Duex: Practical Approaches and Th...Joe Suzuki
 
分枝限定法でモデル選択の計算量を低減する
分枝限定法でモデル選択の計算量を低減する分枝限定法でモデル選択の計算量を低減する
分枝限定法でモデル選択の計算量を低減するJoe Suzuki
 
連続変量を含む条件付相互情報量の推定
連続変量を含む条件付相互情報量の推定連続変量を含む条件付相互情報量の推定
連続変量を含む条件付相互情報量の推定Joe Suzuki
 
E-learning Design and Development for Data Science in Osaka University
E-learning Design and Development for Data Science in Osaka UniversityE-learning Design and Development for Data Science in Osaka University
E-learning Design and Development for Data Science in Osaka UniversityJoe Suzuki
 
AMBN2017 サテライトワークショップ
AMBN2017 サテライトワークショップAMBN2017 サテライトワークショップ
AMBN2017 サテライトワークショップJoe Suzuki
 
CRAN Rパッケージ BNSLの概要
CRAN Rパッケージ BNSLの概要CRAN Rパッケージ BNSLの概要
CRAN Rパッケージ BNSLの概要Joe Suzuki
 
Forest Learning from Data
Forest Learning from DataForest Learning from Data
Forest Learning from DataJoe Suzuki
 
A Bayesian Approach to Data Compression
A Bayesian Approach to Data CompressionA Bayesian Approach to Data Compression
A Bayesian Approach to Data CompressionJoe Suzuki
 
A Conjecture on Strongly Consistent Learning
A Conjecture on Strongly Consistent LearningA Conjecture on Strongly Consistent Learning
A Conjecture on Strongly Consistent LearningJoe Suzuki
 
A Generalization of the Chow-Liu Algorithm and its Applications to Artificial...
A Generalization of the Chow-Liu Algorithm and its Applications to Artificial...A Generalization of the Chow-Liu Algorithm and its Applications to Artificial...
A Generalization of the Chow-Liu Algorithm and its Applications to Artificial...Joe Suzuki
 
A Generalization of Nonparametric Estimation and On-Line Prediction for Stati...
A Generalization of Nonparametric Estimation and On-Line Prediction for Stati...A Generalization of Nonparametric Estimation and On-Line Prediction for Stati...
A Generalization of Nonparametric Estimation and On-Line Prediction for Stati...Joe Suzuki
 
研究紹介(学生向け)
研究紹介(学生向け)研究紹介(学生向け)
研究紹介(学生向け)Joe Suzuki
 
Bayesian Criteria based on Universal Measures
Bayesian Criteria based on Universal MeasuresBayesian Criteria based on Universal Measures
Bayesian Criteria based on Universal MeasuresJoe Suzuki
 
MDL/Bayesian Criteria based on Universal Coding/Measure
MDL/Bayesian Criteria based on Universal Coding/MeasureMDL/Bayesian Criteria based on Universal Coding/Measure
MDL/Bayesian Criteria based on Universal Coding/MeasureJoe Suzuki
 
The Universal Measure for General Sources and its Application to MDL/Bayesian...
The Universal Measure for General Sources and its Application to MDL/Bayesian...The Universal Measure for General Sources and its Application to MDL/Bayesian...
The Universal Measure for General Sources and its Application to MDL/Bayesian...Joe Suzuki
 
Universal Prediction without assuming either Discrete or Continuous
Universal Prediction without assuming either Discrete or ContinuousUniversal Prediction without assuming either Discrete or Continuous
Universal Prediction without assuming either Discrete or ContinuousJoe Suzuki
 
Bayesian network structure estimation based on the Bayesian/MDL criteria when...
Bayesian network structure estimation based on the Bayesian/MDL criteria when...Bayesian network structure estimation based on the Bayesian/MDL criteria when...
Bayesian network structure estimation based on the Bayesian/MDL criteria when...Joe Suzuki
 

More from Joe Suzuki (20)

RとPythonを比較する
RとPythonを比較するRとPythonを比較する
RとPythonを比較する
 
R集会@統数研
R集会@統数研R集会@統数研
R集会@統数研
 
E-learning Development of Statistics and in Duex: Practical Approaches and Th...
E-learning Development of Statistics and in Duex: Practical Approaches and Th...E-learning Development of Statistics and in Duex: Practical Approaches and Th...
E-learning Development of Statistics and in Duex: Practical Approaches and Th...
 
分枝限定法でモデル選択の計算量を低減する
分枝限定法でモデル選択の計算量を低減する分枝限定法でモデル選択の計算量を低減する
分枝限定法でモデル選択の計算量を低減する
 
連続変量を含む条件付相互情報量の推定
連続変量を含む条件付相互情報量の推定連続変量を含む条件付相互情報量の推定
連続変量を含む条件付相互情報量の推定
 
E-learning Design and Development for Data Science in Osaka University
E-learning Design and Development for Data Science in Osaka UniversityE-learning Design and Development for Data Science in Osaka University
E-learning Design and Development for Data Science in Osaka University
 
UAI 2017
UAI 2017UAI 2017
UAI 2017
 
AMBN2017 サテライトワークショップ
AMBN2017 サテライトワークショップAMBN2017 サテライトワークショップ
AMBN2017 サテライトワークショップ
 
CRAN Rパッケージ BNSLの概要
CRAN Rパッケージ BNSLの概要CRAN Rパッケージ BNSLの概要
CRAN Rパッケージ BNSLの概要
 
Forest Learning from Data
Forest Learning from DataForest Learning from Data
Forest Learning from Data
 
A Bayesian Approach to Data Compression
A Bayesian Approach to Data CompressionA Bayesian Approach to Data Compression
A Bayesian Approach to Data Compression
 
A Conjecture on Strongly Consistent Learning
A Conjecture on Strongly Consistent LearningA Conjecture on Strongly Consistent Learning
A Conjecture on Strongly Consistent Learning
 
A Generalization of the Chow-Liu Algorithm and its Applications to Artificial...
A Generalization of the Chow-Liu Algorithm and its Applications to Artificial...A Generalization of the Chow-Liu Algorithm and its Applications to Artificial...
A Generalization of the Chow-Liu Algorithm and its Applications to Artificial...
 
A Generalization of Nonparametric Estimation and On-Line Prediction for Stati...
A Generalization of Nonparametric Estimation and On-Line Prediction for Stati...A Generalization of Nonparametric Estimation and On-Line Prediction for Stati...
A Generalization of Nonparametric Estimation and On-Line Prediction for Stati...
 
研究紹介(学生向け)
研究紹介(学生向け)研究紹介(学生向け)
研究紹介(学生向け)
 
Bayesian Criteria based on Universal Measures
Bayesian Criteria based on Universal MeasuresBayesian Criteria based on Universal Measures
Bayesian Criteria based on Universal Measures
 
MDL/Bayesian Criteria based on Universal Coding/Measure
MDL/Bayesian Criteria based on Universal Coding/MeasureMDL/Bayesian Criteria based on Universal Coding/Measure
MDL/Bayesian Criteria based on Universal Coding/Measure
 
The Universal Measure for General Sources and its Application to MDL/Bayesian...
The Universal Measure for General Sources and its Application to MDL/Bayesian...The Universal Measure for General Sources and its Application to MDL/Bayesian...
The Universal Measure for General Sources and its Application to MDL/Bayesian...
 
Universal Prediction without assuming either Discrete or Continuous
Universal Prediction without assuming either Discrete or ContinuousUniversal Prediction without assuming either Discrete or Continuous
Universal Prediction without assuming either Discrete or Continuous
 
Bayesian network structure estimation based on the Bayesian/MDL criteria when...
Bayesian network structure estimation based on the Bayesian/MDL criteria when...Bayesian network structure estimation based on the Bayesian/MDL criteria when...
Bayesian network structure estimation based on the Bayesian/MDL criteria when...
 

公開鍵暗号1: RSA暗号

  • 1. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 実験数学 3 (大阪大学理学部数学科 3 年・4 年) 第 1 回: RSA 暗号 鈴木 譲 2013 年 4 月 11 日 1 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 2. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 概要 1 はじめに 2 ユークリッド互除法 3 RSA 暗号 4 安全性の根拠 5 暗号化の高速化 2 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 3. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 公開鍵暗号 送信側 受信側 m 平文 -暗号化 f c := f (m) 暗号文 - 送信 -· · · - 受信 - c 暗号文 復号化 f −1 - m := f −1(c) 平文 共通鍵暗号と公開鍵暗号 共通鍵暗号 (戦争)  暗号化 f : 秘密, 復号化 f −1: 秘密 公開鍵暗号 (インターネット)  暗号化 f : 公開, 復号化 f −1: 秘密 知らない相手に、暗号化 f をすぐに教える f ↔ f −1 であっても、f → f −1 の計算が膨大   RSA 暗号: Rivest, Shamir, Adleman (1976): 公開鍵暗号の 1 種 3 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 4. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 ユークリッド互除法 Z: 整数全体 a, b, c ∈ Z, a ≥ 0, b > 0 . 1 b|a def ⇐⇒ k ∈ Z s.t. bk = a . 2 a mod b = c def ⇐⇒ { b|(a − c) 0 ≤ c ≤ b − 1 . 3 (a, b): a, b の最大公約数 > 0 b|a =⇒ (a, b) = b a modb = c =⇒ { (a, b)|c (b, c)|a =⇒ { (a, b)|(b, c) (b, c)|(a, b) =⇒ (a, b) = (b, c) {ai }n i=1 : { a1 ≥ 0, a2 > 0, an|an−1 ai mod ai+1 = ai+2 > 0, i = 1, · · · , n − 2 =⇒ (a1, a2) = · · · = (an−1, an) = an 4 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 5. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 a ≥ 0, b > 0 =⇒ ∃x, y ∈ Z s.t. ax + by = (a, b) {ai }n i=1, {xi }n i=1, {yi }n i=1 を以下で定義: a1 := a, a2 := b, x1 := 1, y1 := 0, x2 := 0, y2 := 1 ax1 + by1 = a1 (1) ax2 + by2 = a2 (2) a3 := a1 mod a2, q := a1 − a3 a2 , x3 := x1 − qx2, y3 := y1 − qy2 ax3 + by3 = a3 (3) これをくりかえすと、 axn + byn = an = (a, b) 5 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 6. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 a ≡ c (mod b) def ⇐⇒ b|(a − c) a1 ≡ c1, a2 ≡ c2 (mod b) =⇒ a1 + a2 ≡ c1 + c2 (mod b) a1 ≡ c1, a2 ≡ c2 (mod b) =⇒ a1a2 ≡ c1c2 (mod b) a ≥ 0, b > 0, (a, b) = 1 =⇒ ∃x ∈ Z s.t.ax ≡ 1(mod b) . (a, b) = 1 であれば、ax + by = 1 なる x, y ∈ Z が存在するから 6 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 7. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 RSA 暗号: 鍵生成 公開鍵 (n, e) と秘密鍵 d の生成 . . . 各自が、公開鍵 (n, e) を公開、秘密鍵 d を秘密に . 1 素数 p ̸= q を選ぶ . 2 n := pq, ϕ := (p − 1)(q − 1) . 3 (e, ϕ) = 1 なる e (mod ϕ) を選ぶ (1 ≤ e ≤ ϕ − 1) . 4 ex ≡ 1 (mod ϕ) なる x = d を選ぶ (1 ≤ d ≤ ϕ − 1) ed ≡ ed′ ≡ 1 (mod ϕ) =⇒ e(d − d′ ) ≡ 0 (mod ϕ) =⇒ d − d′ ≡ 0 (mod ϕ) k ∈ Z, ed ≡ 1 (mod ϕ) =⇒ e(d + kϕ) ≡ 1 (mod ϕ) 7 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 8. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 RSA 暗号: 暗号化と復号化 平文 m ∈ [0, n − 1] を暗号化して、c := me mod n . . . 送信側は、受信側の公開鍵 (n, e) で平文 m を暗号化 長ければ、短いブロックに区切り、それぞれを n 通りの平文 送信側 受信側 m -暗号化 c := me mod n- 送信 -· · · - 受信 - c 復号化 - m = cd mod n (me )d ≡ m (mod n) 仮定: (n, e) → d の計算が膨大で、d はわからない 8 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 9. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 Fermat の小定理: p: 素数, m ∈ Z (m ≥ 0) (m, p) = 1 =⇒ mp−1 ≡ 1 (mod p) 1 ≤ k ≤ p − 1 =⇒    k! ( p k ) = ∏p j=p−k+1 j ≡ 0 (mod p) k! ̸≡ 0 (mod p) =⇒ ( p k ) ≡ 0 (mod p) (a1 + a2)p − (ap 1 + ap 2) = p−1∑ k=1 ( p k ) ak 1ap−k 2 ≡ 0 (mod p) 数学的帰納法で一般の m に拡張し、a1 = · · · = am = 1 とおくと (1 + · · · + 1 m )p − (1p + · · · + 1p m ) ≡ 0 (mod p) m(mp−1 − 1) ≡ 0 (mod p) 9 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 10. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 med ≡ m (mod n) ed ≡ 1 (mod ϕ) より、ed = 1 + kϕ なる整数 k が存在. 1 (m, p) = 1 であれば、Fermat の小定理から mp−1 ≡ 1 (mod p) m1+kϕ = m1+k(p−1)(q−1) = m · (mp−1 )k(q−1) ≡ m (mod p) med ≡ m (mod p) (4) . 2 (m, p) = p でも (4) は成立 p, q を入れ替えても (4) は成立する。 med ≡ m (mod q) p ̸= q より、(p, q) = 1 であるので、 med ≡ m (mod pq) 10 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 11. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 安全性の根拠 RSA 暗号の安全性 . . . (n, e) → d は数学的に一意だが、計算量が膨大 商用の n は、n = 21024, 22048 程度 =⇒ 最速の計算機でも素因数分解に 10 年かかる   RSA 暗号を破るには 計算機で n = pq と因数分解できる =⇒ ϕ = (p − 1)(q − 1) が求まる =⇒ e の値とユークリッド互除法で d が求まる 大きな数 n の素因数分解 大きな数 n のオイラー数 ϕ の計算 現在の計算機で素因数分解が難しいことが、安全性の根拠 11 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 12. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 参考: me mod n の高速化 再帰的に計算して、e ではなく、log2 e に比例する程度の計算 me mod n =    (me/2 mod )2 mod n (e : even, e ̸= 0) m · (m(e−1)/2 mod n)2 mod n (e : odd) 1 (e = 0) 12 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号