SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
実験数学 3
(大阪大学理学部数学科 3 年・4 年)
第 1 回: RSA 暗号
鈴木 譲
2014 年 4 月 10 日
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 が インター
類推されにくい ネット
 
公開鍵暗号の例: RSA 暗号 (Rivest, Shamir, Adleman, 1976)
3 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
ユークリッド互除法
Z: 整数全体
a, b, c ∈ Z, 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 :



a2 ̸= 0
ai mod ai+1 = ai+2 ̸= 0, i = 1, · · · , n − 2
an−1 mod an = 0
=⇒ (a1, a2) = · · · = (an−1, an) = an
4 / 12
実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化
a = b = 0 でない =⇒ ∃x, y ∈ Z s.t. ax + by = (a, b)
b = 0 のとき x = 1 が解になるので、b ̸= 0 を仮定して、
{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 暗号 安全性の根拠 暗号化の高速化
b ̸= 0 のとき、同値関係 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)
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)
(c1 + c2)p
− (cp
1 + cp
2 ) =
p−1∑
k=1
(
p
k
)
ck
1 cp−k
2 ≡ 0 (mod p)
数学的帰納法で一般の m に拡張し、c1 = · · · = cm = 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 暗号

Más contenido relacionado

La actualidad más candente

パターン認識 第12章 正則化とパス追跡アルゴリズム
パターン認識 第12章 正則化とパス追跡アルゴリズムパターン認識 第12章 正則化とパス追跡アルゴリズム
パターン認識 第12章 正則化とパス追跡アルゴリズムMiyoshi Yuya
 
Infinite SVM - ICML 2011 読み会
Infinite SVM - ICML 2011 読み会Infinite SVM - ICML 2011 読み会
Infinite SVM - ICML 2011 読み会Shuyo Nakatani
 
整数格子点上の劣モジュラ被覆に対する高速アルゴリズム
整数格子点上の劣モジュラ被覆に対する高速アルゴリズム整数格子点上の劣モジュラ被覆に対する高速アルゴリズム
整数格子点上の劣モジュラ被覆に対する高速アルゴリズムTasuku Soma
 
introductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysisintroductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysisTatsuki SHIMIZU
 
Magnitude ~ extend the Euler Characteristics via Möbius Inversion ~
Magnitude ~ extend the Euler Characteristics via  Möbius Inversion ~Magnitude ~ extend the Euler Characteristics via  Möbius Inversion ~
Magnitude ~ extend the Euler Characteristics via Möbius Inversion ~Tatsuki SHIMIZU
 
範囲証明つき準同型暗号とその対話的プロトコル
範囲証明つき準同型暗号とその対話的プロトコル範囲証明つき準同型暗号とその対話的プロトコル
範囲証明つき準同型暗号とその対話的プロトコルMITSUNARI Shigeo
 
K2PC Div1 E 暗号化
K2PC Div1 E 暗号化K2PC Div1 E 暗号化
K2PC Div1 E 暗号化Kazuma Mikami
 
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃trmr
 
Infinite SVM [改] - ICML 2011 読み会
Infinite SVM [改] - ICML 2011 読み会Infinite SVM [改] - ICML 2011 読み会
Infinite SVM [改] - ICML 2011 読み会Shuyo Nakatani
 
AtCoder Regular Contest 046
AtCoder Regular Contest 046AtCoder Regular Contest 046
AtCoder Regular Contest 046AtCoder Inc.
 
RUPC2014_Day2_C
RUPC2014_Day2_CRUPC2014_Day2_C
RUPC2014_Day2_Cs1190048
 
Scala 初心者が Hom 函手を Scala で考えてみた
Scala 初心者が Hom 函手を Scala で考えてみたScala 初心者が Hom 函手を Scala で考えてみた
Scala 初心者が Hom 函手を Scala で考えてみたKazuyuki TAKASE
 
情報オリンピック夏合宿発表
情報オリンピック夏合宿発表情報オリンピック夏合宿発表
情報オリンピック夏合宿発表Kazuma Mikami
 
競技プログラミングの楽しみ
競技プログラミングの楽しみ競技プログラミングの楽しみ
競技プログラミングの楽しみna_o_ys
 

La actualidad más candente (20)

パターン認識 第12章 正則化とパス追跡アルゴリズム
パターン認識 第12章 正則化とパス追跡アルゴリズムパターン認識 第12章 正則化とパス追跡アルゴリズム
パターン認識 第12章 正則化とパス追跡アルゴリズム
 
Infinite SVM - ICML 2011 読み会
Infinite SVM - ICML 2011 読み会Infinite SVM - ICML 2011 読み会
Infinite SVM - ICML 2011 読み会
 
整数格子点上の劣モジュラ被覆に対する高速アルゴリズム
整数格子点上の劣モジュラ被覆に対する高速アルゴリズム整数格子点上の劣モジュラ被覆に対する高速アルゴリズム
整数格子点上の劣モジュラ被覆に対する高速アルゴリズム
 
abc031
abc031abc031
abc031
 
introductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysisintroductino to persistent homology and topological data analysis
introductino to persistent homology and topological data analysis
 
Magnitude ~ extend the Euler Characteristics via Möbius Inversion ~
Magnitude ~ extend the Euler Characteristics via  Möbius Inversion ~Magnitude ~ extend the Euler Characteristics via  Möbius Inversion ~
Magnitude ~ extend the Euler Characteristics via Möbius Inversion ~
 
範囲証明つき準同型暗号とその対話的プロトコル
範囲証明つき準同型暗号とその対話的プロトコル範囲証明つき準同型暗号とその対話的プロトコル
範囲証明つき準同型暗号とその対話的プロトコル
 
K2PC Div1 E 暗号化
K2PC Div1 E 暗号化K2PC Div1 E 暗号化
K2PC Div1 E 暗号化
 
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃
katagaitai workshop #7 crypto ナップサック暗号と低密度攻撃
 
6 Info Theory
6 Info Theory6 Info Theory
6 Info Theory
 
FHE in Action
FHE in ActionFHE in Action
FHE in Action
 
動的計画法を極める!
動的計画法を極める!動的計画法を極める!
動的計画法を極める!
 
Infinite SVM [改] - ICML 2011 読み会
Infinite SVM [改] - ICML 2011 読み会Infinite SVM [改] - ICML 2011 読み会
Infinite SVM [改] - ICML 2011 読み会
 
AtCoder Regular Contest 046
AtCoder Regular Contest 046AtCoder Regular Contest 046
AtCoder Regular Contest 046
 
SVM
SVMSVM
SVM
 
RUPC2014_Day2_C
RUPC2014_Day2_CRUPC2014_Day2_C
RUPC2014_Day2_C
 
Scala 初心者が Hom 函手を Scala で考えてみた
Scala 初心者が Hom 函手を Scala で考えてみたScala 初心者が Hom 函手を Scala で考えてみた
Scala 初心者が Hom 函手を Scala で考えてみた
 
情報オリンピック夏合宿発表
情報オリンピック夏合宿発表情報オリンピック夏合宿発表
情報オリンピック夏合宿発表
 
競技プログラミングの楽しみ
競技プログラミングの楽しみ競技プログラミングの楽しみ
競技プログラミングの楽しみ
 
計算量
計算量計算量
計算量
 

Destacado

公開鍵暗号(6): ナップザック暗号
公開鍵暗号(6): ナップザック暗号公開鍵暗号(6): ナップザック暗号
公開鍵暗号(6): ナップザック暗号Joe Suzuki
 
公開鍵暗号(2): 有限体
公開鍵暗号(2): 有限体公開鍵暗号(2): 有限体
公開鍵暗号(2): 有限体Joe Suzuki
 
Experimental mathematics 2
Experimental mathematics 2Experimental mathematics 2
Experimental mathematics 2Joe Suzuki
 
MaCaulay2 Miuraパッケージの開発と今後
MaCaulay2 Miuraパッケージの開発と今後MaCaulay2 Miuraパッケージの開発と今後
MaCaulay2 Miuraパッケージの開発と今後Joe Suzuki
 
公開鍵暗号(5): NP困難性
公開鍵暗号(5): NP困難性公開鍵暗号(5): NP困難性
公開鍵暗号(5): NP困難性Joe Suzuki
 
相互情報量を用いた独立性の検定
相互情報量を用いた独立性の検定相互情報量を用いた独立性の検定
相互情報量を用いた独立性の検定Joe Suzuki
 
公開鍵暗号(7): データ圧縮
公開鍵暗号(7): データ圧縮公開鍵暗号(7): データ圧縮
公開鍵暗号(7): データ圧縮Joe Suzuki
 
公開鍵暗号(4): 楕円曲線における離散対数問題
公開鍵暗号(4): 楕円曲線における離散対数問題公開鍵暗号(4): 楕円曲線における離散対数問題
公開鍵暗号(4): 楕円曲線における離散対数問題Joe Suzuki
 
公開鍵暗号(3): 離散対数問題
公開鍵暗号(3): 離散対数問題公開鍵暗号(3): 離散対数問題
公開鍵暗号(3): 離散対数問題Joe Suzuki
 
Jeffreysの事前確率とBDeuの一致性に関する比較
Jeffreysの事前確率とBDeuの一致性に関する比較Jeffreysの事前確率とBDeuの一致性に関する比較
Jeffreysの事前確率とBDeuの一致性に関する比較Joe Suzuki
 
離散と連続の入り混じった相互情報量を推定して、 SNP と遺伝子発現量の因果関係をさぐる
離散と連続の入り混じった相互情報量を推定して、SNP と遺伝子発現量の因果関係をさぐる離散と連続の入り混じった相互情報量を推定して、SNP と遺伝子発現量の因果関係をさぐる
離散と連続の入り混じった相互情報量を推定して、 SNP と遺伝子発現量の因果関係をさぐるJoe Suzuki
 
Bayes Independence Test - HSIC と性能を比較する-
Bayes Independence Test - HSIC と性能を比較する-Bayes Independence Test - HSIC と性能を比較する-
Bayes Independence Test - HSIC と性能を比較する-Joe Suzuki
 
Grammatical inference メモ 1
Grammatical inference メモ 1Grammatical inference メモ 1
Grammatical inference メモ 1Keisuke OTAKI
 
Reading Seminar (140515) Spectral Learning of L-PCFGs
Reading Seminar (140515) Spectral Learning of L-PCFGsReading Seminar (140515) Spectral Learning of L-PCFGs
Reading Seminar (140515) Spectral Learning of L-PCFGsKeisuke OTAKI
 
一階述語論理のメモ
一階述語論理のメモ一階述語論理のメモ
一階述語論理のメモKeisuke OTAKI
 

Destacado (20)

2014 9-26
2014 9-262014 9-26
2014 9-26
 
公開鍵暗号(6): ナップザック暗号
公開鍵暗号(6): ナップザック暗号公開鍵暗号(6): ナップザック暗号
公開鍵暗号(6): ナップザック暗号
 
2014 9-22
2014 9-222014 9-22
2014 9-22
 
公開鍵暗号(2): 有限体
公開鍵暗号(2): 有限体公開鍵暗号(2): 有限体
公開鍵暗号(2): 有限体
 
Experimental mathematics 2
Experimental mathematics 2Experimental mathematics 2
Experimental mathematics 2
 
基本概念
基本概念基本概念
基本概念
 
MaCaulay2 Miuraパッケージの開発と今後
MaCaulay2 Miuraパッケージの開発と今後MaCaulay2 Miuraパッケージの開発と今後
MaCaulay2 Miuraパッケージの開発と今後
 
公開鍵暗号(5): NP困難性
公開鍵暗号(5): NP困難性公開鍵暗号(5): NP困難性
公開鍵暗号(5): NP困難性
 
相互情報量を用いた独立性の検定
相互情報量を用いた独立性の検定相互情報量を用いた独立性の検定
相互情報量を用いた独立性の検定
 
公開鍵暗号(7): データ圧縮
公開鍵暗号(7): データ圧縮公開鍵暗号(7): データ圧縮
公開鍵暗号(7): データ圧縮
 
公開鍵暗号(4): 楕円曲線における離散対数問題
公開鍵暗号(4): 楕円曲線における離散対数問題公開鍵暗号(4): 楕円曲線における離散対数問題
公開鍵暗号(4): 楕円曲線における離散対数問題
 
公開鍵暗号(3): 離散対数問題
公開鍵暗号(3): 離散対数問題公開鍵暗号(3): 離散対数問題
公開鍵暗号(3): 離散対数問題
 
Jeffreysの事前確率とBDeuの一致性に関する比較
Jeffreysの事前確率とBDeuの一致性に関する比較Jeffreysの事前確率とBDeuの一致性に関する比較
Jeffreysの事前確率とBDeuの一致性に関する比較
 
2014 12-9
2014 12-92014 12-9
2014 12-9
 
離散と連続の入り混じった相互情報量を推定して、 SNP と遺伝子発現量の因果関係をさぐる
離散と連続の入り混じった相互情報量を推定して、SNP と遺伝子発現量の因果関係をさぐる離散と連続の入り混じった相互情報量を推定して、SNP と遺伝子発現量の因果関係をさぐる
離散と連続の入り混じった相互情報量を推定して、 SNP と遺伝子発現量の因果関係をさぐる
 
Bayes Independence Test - HSIC と性能を比較する-
Bayes Independence Test - HSIC と性能を比較する-Bayes Independence Test - HSIC と性能を比較する-
Bayes Independence Test - HSIC と性能を比較する-
 
Grammatical inference メモ 1
Grammatical inference メモ 1Grammatical inference メモ 1
Grammatical inference メモ 1
 
Hash Table
Hash TableHash Table
Hash Table
 
Reading Seminar (140515) Spectral Learning of L-PCFGs
Reading Seminar (140515) Spectral Learning of L-PCFGsReading Seminar (140515) Spectral Learning of L-PCFGs
Reading Seminar (140515) Spectral Learning of L-PCFGs
 
一階述語論理のメモ
一階述語論理のメモ一階述語論理のメモ
一階述語論理のメモ
 

Similar a 公開鍵暗号(1): RSA暗号

Shunsuke Horii
Shunsuke HoriiShunsuke Horii
Shunsuke HoriiSuurist
 
Deep learning _linear_algebra___probablity___information
Deep learning _linear_algebra___probablity___informationDeep learning _linear_algebra___probablity___information
Deep learning _linear_algebra___probablity___informationtakutori
 
公開鍵暗号3: ナップザック暗号
公開鍵暗号3: ナップザック暗号公開鍵暗号3: ナップザック暗号
公開鍵暗号3: ナップザック暗号Joe Suzuki
 
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2東京都市大学 データ解析入門 7 回帰分析とモデル選択 2
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2hirokazutanaka
 
RSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpRSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpsonickun
 
パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化Miyoshi Yuya
 
深層学習と確率プログラミングを融合したEdwardについて
深層学習と確率プログラミングを融合したEdwardについて深層学習と確率プログラミングを融合したEdwardについて
深層学習と確率プログラミングを融合したEdwardについてryosuke-kojima
 
代数的実数とCADの実装紹介
代数的実数とCADの実装紹介代数的実数とCADの実装紹介
代数的実数とCADの実装紹介Masahiro Sakai
 
Provable Security1
Provable Security1Provable Security1
Provable Security1Satoshi Hada
 
Sparse pca via bipartite matching
Sparse pca via bipartite matchingSparse pca via bipartite matching
Sparse pca via bipartite matchingKimikazu Kato
 
暗号技術入門 秘密の国のアリス 総集編
暗号技術入門 秘密の国のアリス 総集編暗号技術入門 秘密の国のアリス 総集編
暗号技術入門 秘密の国のアリス 総集編京大 マイコンクラブ
 
How to study stat
How to study statHow to study stat
How to study statAk Ok
 
20170327_レムニスケートにまつわる色々な計算
20170327_レムニスケートにまつわる色々な計算20170327_レムニスケートにまつわる色々な計算
20170327_レムニスケートにまつわる色々な計算matsumoring
 
JOIss2020 発表資料
JOIss2020 発表資料JOIss2020 発表資料
JOIss2020 発表資料mdkcpp 1015
 
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...Yuya Masumura
 

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

Shunsuke Horii
Shunsuke HoriiShunsuke Horii
Shunsuke Horii
 
Deep learning _linear_algebra___probablity___information
Deep learning _linear_algebra___probablity___informationDeep learning _linear_algebra___probablity___information
Deep learning _linear_algebra___probablity___information
 
公開鍵暗号3: ナップザック暗号
公開鍵暗号3: ナップザック暗号公開鍵暗号3: ナップザック暗号
公開鍵暗号3: ナップザック暗号
 
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2東京都市大学 データ解析入門 7 回帰分析とモデル選択 2
東京都市大学 データ解析入門 7 回帰分析とモデル選択 2
 
NLPforml5
NLPforml5NLPforml5
NLPforml5
 
RSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjpRSA暗号運用でやってはいけない n のこと #ssmjp
RSA暗号運用でやってはいけない n のこと #ssmjp
 
パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化パターン認識第9章 学習ベクトル量子化
パターン認識第9章 学習ベクトル量子化
 
深層学習と確率プログラミングを融合したEdwardについて
深層学習と確率プログラミングを融合したEdwardについて深層学習と確率プログラミングを融合したEdwardについて
深層学習と確率プログラミングを融合したEdwardについて
 
代数的実数とCADの実装紹介
代数的実数とCADの実装紹介代数的実数とCADの実装紹介
代数的実数とCADの実装紹介
 
Provable Security1
Provable Security1Provable Security1
Provable Security1
 
Sparse pca via bipartite matching
Sparse pca via bipartite matchingSparse pca via bipartite matching
Sparse pca via bipartite matching
 
Prml sec6
Prml sec6Prml sec6
Prml sec6
 
Summer seminar
Summer seminarSummer seminar
Summer seminar
 
暗号技術入門 秘密の国のアリス 総集編
暗号技術入門 秘密の国のアリス 総集編暗号技術入門 秘密の国のアリス 総集編
暗号技術入門 秘密の国のアリス 総集編
 
How to study stat
How to study statHow to study stat
How to study stat
 
20170327_レムニスケートにまつわる色々な計算
20170327_レムニスケートにまつわる色々な計算20170327_レムニスケートにまつわる色々な計算
20170327_レムニスケートにまつわる色々な計算
 
JSIAM_2019_9_4
JSIAM_2019_9_4JSIAM_2019_9_4
JSIAM_2019_9_4
 
JOIss2020 発表資料
JOIss2020 発表資料JOIss2020 発表資料
JOIss2020 発表資料
 
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...
半正定値計画問題と最大カット Sedemifinite Programming and Approximation Algorithm for Maxcu...
 
主成分分析
主成分分析主成分分析
主成分分析
 

Más de 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
 

Más de 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 暗号 鈴木 譲 2014 年 4 月 10 日 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 が インター 類推されにくい ネット   公開鍵暗号の例: RSA 暗号 (Rivest, Shamir, Adleman, 1976) 3 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 4. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 ユークリッド互除法 Z: 整数全体 a, b, c ∈ Z, 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 :    a2 ̸= 0 ai mod ai+1 = ai+2 ̸= 0, i = 1, · · · , n − 2 an−1 mod an = 0 =⇒ (a1, a2) = · · · = (an−1, an) = an 4 / 12 実験数学 3, (大阪大学理学部数学科 3 年・4 年), 第 1 回: RSA 暗号
  • 5. 概要 はじめに ユークリッド互除法 RSA 暗号 安全性の根拠 暗号化の高速化 a = b = 0 でない =⇒ ∃x, y ∈ Z s.t. ax + by = (a, b) b = 0 のとき x = 1 が解になるので、b ̸= 0 を仮定して、 {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 暗号 安全性の根拠 暗号化の高速化 b ̸= 0 のとき、同値関係 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) 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) (c1 + c2)p − (cp 1 + cp 2 ) = p−1∑ k=1 ( p k ) ck 1 cp−k 2 ≡ 0 (mod p) 数学的帰納法で一般の m に拡張し、c1 = · · · = cm = 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 暗号