Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
暗号技術入門ゼミ 第 2 章前編/Cryptography Primer Semi s2-1
Search
y_k
February 06, 2019
0
90
暗号技術入門ゼミ 第 2 章前編/Cryptography Primer Semi s2-1
暗号技術入門 第3版 第 2 章 歴史上の暗号 -他人が読めない文章を作る- 前編
y_k
February 06, 2019
Tweet
Share
More Decks by y_k
See All by y_k
LDD18Muroran むろらんバスなび
yetanother_yk
0
300
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Music & Morning Musume
bryan
46
6.2k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
A Tale of Four Properties
chriscoyier
156
23k
Fireside Chat
paigeccino
34
3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Producing Creativity
orderedlist
PRO
341
39k
Making Projects Easy
brettharned
115
5.9k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Typedesign – Prime Four
hannesfritz
40
2.4k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Transcript
҉߸ٕज़ೖ ୈ 3 ൛ ୈ 2 ষ ྺ্࢙ͷ҉߸ -ଞਓ͕ಡΊͳ͍จষΛ࡞Δ- લฤ
Koki Yamada February 6, 2019 Muroran-IT σʔλαΠΤϯεݚڀࣨ
͜ͷষͰֶͿ͜ͱ ྺ্࢙࣮ࡍʹΘΕ͖ͯͨ༗໊ͳ҉߸: • γʔβʔ҉߸ • ୯Ұࣈ҉߸ • ΤχάϚ ҉߸ղಡ๏: •
ϒϧʔτɾϑΥʔεɾΞλοΫ • සੳ 1
͜ͷষͰֶͿ͜ͱ ྺ্࢙࣮ࡍʹΘΕ͖ͯͨ༗໊ͳ҉߸: • γʔβʔ҉߸ • ୯Ұࣈ҉߸ • ΤχάϚ ҉߸ղಡ๏: •
ϒϧʔτɾϑΥʔεɾΞλοΫ • සੳ 1
γʔβʔ҉߸
γʔβʔ҉߸ͱ • γʔβʔ҉߸ (caesar cipher) • δϡϦΞεɾγʔβʔʢϢϦεɾΧΤαϧʣ͕͍ͬͯͨ ͱݴΘΕΔ҉߸ • Ұఆͷจࣈ͚ͩʮͣΒ͢ʯ͜ͱʹΑͬͯ҉߸Խ
B C D E F G H I % & ' ( ) จࣈͣΒ͢ 2
ࢼͯ͠ΈΔ https://paiza.io/projects/tGZvu3P_NiusVSHU0cXKWw • encode('yamada') ˠ 'BDPDGD' • decode('BDPDGD') ˠ 'yamada'
3
Ͳ͏ͬͯղಡ͢Δʁ • γʔβʔ҉߸: ͣΒ͢෯Λಛఆ͢Εྑ͍ 4
Ͳ͏ͬͯղಡ͢Δʁ • γʔβʔ҉߸: ͣΒ͢෯Λಛఆ͢Εྑ͍ ྫ: 'PXURUDQ' 4
Ͳ͏ͬͯղಡ͢Δʁ • γʔβʔ҉߸: ͣΒ͢෯Λಛఆ͢Εྑ͍ ྫ: 'PXURUDQ' for i in range(1,
27): print(i, decode('PXURUDQ', i)) 4
Ͳ͏ͬͯղಡ͢Δʁ • γʔβʔ҉߸: ͣΒ͢෯Λಛఆ͢Εྑ͍ ྫ: 'PXURUDQ' 1. owtqtcp 2. nvspsbo
3. muroran 4. ltqnqzm 5. kspmpyl 6. jroloxk 7. iqnknwj 8. hpmjmvi ˠ ʮϒϧʔτɾϑΥʔεɾΞλοΫʯ 4
ϒϧʔτɾϑΥʔεɾΞλοΫ
ϒϧʔτɾϑΥʔεɾΞλοΫͱ • ϒϧʔτɾϑΥʔεɾΞλοΫ (brute-force attack) • ͯ͢ͷݤͷީิΛࢼͯ͠ΈΔͷ • શ୳ࡧɼ૯ͨΓ๏ɼ͠ΒΈͭͿ͠๏ͳͲͱݺΕΔ 5
୯Ұࣈ҉߸
୯Ұࣈ҉߸ͱ • ୯Ұࣈ҉߸ (simple substitution cipher) • จࣈಉ࢜ʹ 1 ର
1 ͷରԠؔ 6
۩ମྫ ʜ B C D E F G H I
% & ' ( ) " # $ J K L M - * + , N O P 0 . / ʜ B C D E F G H I % & ' ( ) " # $ J K L M - * + , N O P 0 . / Figure 1: ࣈදͷҰྫ 7
ϒϧʔτɾϑΥʔεɾΞλοΫʹΑΔղಡ ݤύλʔϯ: 26 × 25 × 24 × · ·
· × 1 = 403291461126605635584000000 4 ஹͷ 1000 ஹഒ 8
ϒϧʔτɾϑΥʔεɾΞλοΫʹΑΔղಡ ݤύλʔϯ: 26 × 25 × 24 × · ·
· × 1 = 403291461126605635584000000 4 ஹͷ 1000 ஹഒ ϒϧʔτɾϑΥʔεɾΞλοΫʹΑΔղಡࠔ ˠผͷํ๏͕ͳ͍͔ʁ 8
සੳʹΑΔղಡ
සੳ • ฏจʹొ͢Δจࣈͷසͱ҉߸จʹొ͢Δจࣈͷස͕ Ұக͢Δ͜ͱΛར༻ • ӳࣈͷొස: e ˠ t ˠ
a ˠ o ˠ i ˠ n ˠ s ... (ΤυΨʔɾΞϥϯɾϙʔʰԫۚʱ) 9
සੳͷཁ • සͷߴ͍จࣈ͚ͩͰͳ͘ɼ͍จࣈख͕͔Γʹ • ͡ΊͱऴΘΓ͕Θ͔Δͱख͕͔Γʹɼ୯ޠͷ۠ΓΘ͔ Εख͕͔Γʹʁ • ҉߸จ͕͍ͱղಡ͍͢͠ • ಉ͡จࣈͷ࿈ଓख͕͔Γʹ
ʢ͋Δจࣈ͕Ͳͷจࣈʹ҉߸Խ͞ΕΔ͔ܾ·͍ͬͯΔͨΊ • ղಡͷεϐʔυͩΜͩΜ্͕Δ 10
ΫΠζ
ΫΠζ 1: γʔβʔ҉߸ͷղಡ 'PELCGBTENCUL' 11
ΫΠζ 2: ୯Ұࣈ҉߸ͷʮվྑʯ ಉ͡จࣈʹม (c ˠ C, q ˠ Q)
͞Εͳ͍Α͏ͳࣈදΛ͏ͱͲ ͏ͳΔ͔ʁ 12