SlideShare a Scribd company logo
1 of 19
Download to read offline
エニグマとは -歴史-
• 第2次世界大戦時にナチスドイツが使用した暗号機
• 当時世界最先端の装置
(後に大戦中に連合軍によって解読された)
余談
• エニグマで暗号化して無線通信をすることで,
Uボートは効果的に作戦を行うことができた
• 「計算機科学の父」Alan Turingも解読に携わった
前提: 換字式暗号について
単一換字式暗号
• 平文の文字に対して,必ず同じ暗号文の文字に変換される
• アルファベット1文字に対して暗号文字は1つ
→ 頻度分析によって解読
A B C D E
・・・
V W X Y Z
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
E D S A V C L M H U
エニグマの各部パーツ
• ローター
• キー・ランプ(入出力)
• プラグボード
画像出典: Bob Lord - German Enigma Machine by en:User:Matt Crypto
https://commons.wikimedia.org/w/index.php?curid=258976
エニグマ -特徴 プラグボード-
使い方
3-10個の文字のペアを作ってケーブルで繋ぐ
目的
プラグの両端に対応する文字を入れ替える
→3.5×106以上の鍵規約数を実現
画像出典: Bob Lord - German Enigma Machine by en:User:Matt Crypto
https://commons.wikimedia.org/w/index.php?curid=258976
エニグマ -特徴 ローター-
役割
• 単文字換字表として動作する
ローター3枚で105,456通り
動作
• ①のローターは1文字入力されるごとに1文字分ずれる
• ②のローターは①のローターが1回転すると1文字分ずれる
• ③のローターは②のローターが1回転すると1文字分ずれる
→Aを入力し続けても,17576回入力しないと
同一文字にならない = 頻度分析対策
画像出典: Enigma_rotor_set by Wapcaplet
https://commons.wikimedia.org/w/index.php?curid=23793
①
②
③
エニグマ -特徴 リフレクター-
役割
• 反転ローターとも呼ばれるが,回転しない
• ローターを通った信号を再びローターに返す
• 暗号化と復号が同じ手順で可能
エニグマとは –機構-
A
B
C
E
D
キー/ライト プラグボード ローター x3 リフレクター
エニグマ -設定-
• ローター配列 (どのローターをどの順で使用するか)
• ローター位置 (1文字目をローターのどこで始めるか)
• プラグボードの組み合わせ
• (日鍵 / 通信鍵)
これらの主に3つの要素の設定で暗号・復号を行う
→本体が盗まれても設定がわからなければ解読が難しい
エニグマの再現
電気機械としてすべてを再現するのはハードルが高い
(技術,コスト)
エニグマをモダンに再実装する
→暗号化の処理はソフトウェアで実装
→入出力は実際に物理ボタンや液晶等で実装
その他の動機
• ソフトウェアの実装だけでは面白くない
• 見た目も凝りたい!(電子工作に挑戦)
対比
ランプ(出力)
ローター
キー
プラグボード
画像出典: Bob Lord - German Enigma Machine by en:User:Matt Crypto
https://commons.wikimedia.org/w/index.php?curid=258976
エニグマ エニグマ
エニグマの再現 -プラグボード-
実装
• 処理途中で変化しないことから,
最初に状態を読み取り記憶しておく
処理順序
• 1つのピンに信号を送信
• 他のすべてのピンの入力を確認
• 入力がある場合接続されているとみなす
(これをA-Zの分だけ繰り返す)
A B C D E
出力 入力を確認
AとEをつないだ場合
エニグマの再現 -ローター-
パーツ
• ロータリースイッチで指定
• 3つのスイッチはそれぞれ5通り選択可能
(5枚のローターから3枚選んで並べる動作を簡略化)
エニグマの再現 -入力-
パーツ
タクトスイッチ + キーキャップ(3Dプリンターで作成)
特徴
• キー配列はオリジナル準拠(QWERTZ配列)+Enterキー
エニグマの再現 -出力-
• LCDキャラクタディスプレイモジュール (SC1602)
• エラー・ステータス・処理結果を表示
エニグマの再現 -外見-
• 3Dプリンターで作成したパーツと木材を使用
エニグマの再現 -処理-
環境
• Raspberry Pi Zero WH
• Raspberry Pi OS Lite
• Python 3.8
エニグマの再現 -処理-
暗号技術入門(結城 浩 著)等を読みつつ設計
換字表
• ローターごとにシードを固定してランダム生成
設定
• プラグボードやローターは状態を記憶→処理
エニグマの再現 -デモ-
リンク集
Twitter: @seigo2018
GitHub : seigo2016
Portfolio: https://seigo2016.com

More Related Content

Featured

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming LanguageSimplilearn
 

Featured (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

EnigmaPi