Professional Documents
Culture Documents
04 Encryption
04 Encryption
What is Security?
• Security:
◦ Free from danger, damage, loss or threats
• Information Security:
◦ Protecting information from access, use, disclosure, disruption,
modification, inspection, recording or destruction
• Cyber Security:
◦ Securing things that are vulnerable through ICT
2
Basic Components of Security
• CIA Triad
◦ Confidentiality: Who is authorized to use data? I
C
◦ Integrity: Is data good? S
◦ Availability: Can access data whenever need it?
A
3
Confidentiality
• Prevention the disclosure of information to
unauthorized individuals or systems
• Confidentiality involves in:
◦ Data Protection
◦ Providing access for those who are allowed
◦ Disallowing others from learning anything
C I
S
4
How to achieve Confidentiality
• Encrpytion
◦ Cryptography
• Access Control
◦ Rules and policies that limit access to confidential information
• Authentication
◦ Determination of the identity
• Authorization
◦ Determination if person is allowed to access
5
Technical view of Cryptography
6
Integrity
• The property that information has not be altered in an
unauthorized way
• Integrity is loss when data is modified undetectably
C I
S
7
How to achieve Integrity
• Backups
• Checksums
• Data correcting codes
8
Availability
• The property that information is accessible and
modifiable in a timely fashion by those authorized to
do so
• Other meaning
◦ Present in a usable form
◦ Enough capacity to meet the service’s needs
◦ Completed services in an acceptable period of time
9
How to achieve Availability
• Physical protections
◦ Infrastructure meant to keep information available even in the
event of physical challenges
◦ Fault tolerance (graceful cessation instead of crash or abrupt)
• System Redundancy
◦ System that serve as fallbacks in the case of failures
C I
S
10
How do we measure availability?
11
World Economic Forum
12
Growth of Cybercrime Costs
13
ผลจากการถูกจารกรรมข้อมูล
• การสืบสวนทางเทคนิค
• การแจ้งเตือนการละเมิดกับลูกค้า
• การปฏิบัติตามข้อบังคับ
• ค่าธรรมเนียมทนายความและการดําเนินคดี
• การคุ้มครองผู้บริโภคหลังการละเมิด
• การประชาสัมพันธ์
• การปรับปรุงความมั่นคงปลอดภัยทางไซเบอร์
• เสียชื่อทางการค้า, ความสัมพันธ์ลูกค้า
14
สิ่งที่ช่วยลดภัยคุกคาม
• คน (People)
◦ เป็นจุดเริ่มต้นของภัยคุกคามทั้งตั้งใจและไม่ตั้งใจ
• กระบวนการ (Process)
◦ นโยบาย ระเบียบ ข้อบังคับ
◦ พระราชบัญญัติการรักษาความมั่นคงปลอดภัยไซเบอร์
◦ พระราชบัญญัติว่าด้วยการกระทําความผิดเกี่ยวกับคอมพิวเตอร์
◦ พระราชบัญญัติคุ้มครองข้อมูลส่วนบุคคล
• เทคโนโลยี (Technology)
◦ OS license, Antivirus
◦ Cyber Insurance
15
Hypertext Transfer Protocol (HTTP)
• Foundation of web technology
• Enable client (web browsers) to request from an HTTP
server
• TCP connection with well-known port 80
https://blog.cloudhm.co.th/what-is-ssl-and-tls/
16
Locks and Combinations
• We buy a lock and set up the combination
• No one else knows the combination
• Forgetting the combination, opening the lock by:
◦ Breaking the lock
◦ Trying every combination
17
The Problem
• Why secret message?
◦ Untrusted unsecure channel
◦ Channel access by a malicious third party
Private Message
Bob Alice
Eavesdropping
Eve
18
The Solution
Encryption Decryption
Scrambled Message
Bob Alice
Eavesdropping
Eve
19
The Solution
Message
(plaintext, Encryption Ciphertext Decryption
cleartext) (Encipherment) (cryptogram) (Decipherment) plaintext
20
Defining Cryptographic Terms (I)
• Plaintext: original message to be encrypted
• Ciphertext: the encrypted message
• Enciphering or encryption: the process of converting
plaintext into ciphertext
• Encryption algorithm: performs encryption
◦ Two inputs: a plaintext and a secret key
21
Defining Cryptographic Terms (II)
• Deciphering or decryption: recovering plaintext from
ciphertext
• Decryption algorithm: performs decryption
◦ Two inputs: ciphertext and secret key
• Secret key: info known only to sender/receiver for
encryption and decryption
◦ Also referred to as a symmetric key
22
Encryption and Decryption Model
Eve
(bad guy)
y
Unsecure channel
(e.g. Internet)
Alice Encryption Decryption Bob
(good) x e () y d () x (good)
K K
Secure Channel
• x is the. plaintext
• y is the ciphertext
• K is the key
23
Taxonomy of Cryptology
Cryptology
Cryptography Cryptanalysis
24
Cryptanalysis: Attacking
25
Brute-Force Attack
• Also known as Exhaustive Key Search
• Treats the cipher as a black box
• Requires (at least) 1 plaintext-ciphertext pair (𝑥!, 𝑦!)
• Check all possible keys until condition is fulfilled:
𝑑" 𝑦! = 𝑥!
26
How many keys do we need?
• An adversary only needs to succeed with one attack
• A long key space does not help if other attacks
(e.g., social engineering) are possible
27
Classical Ciphers Algorithm
• Give a good illustration of several of the
important ideas of the cryptography
28
Caesar’s Cipher
29
Caesar’s Cipher
• Ancient cipher, allegedly used by
Julius Caesar (Born: 100 BC)
• Also known as Shift cipher, Caesar's
code or Caesar shift
• Rule: Replacing each plaintext letter
by another one by shift its k
positions further down the alphabet
• Caesar cipher: A shift of 3
characters
Example: FIVE AM => ILYH DP
Plaintext A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Ciphertext D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
30
Caesar’s Disk
• Also known as a rot-N encoder A construction
• Encryption of “FIVE AM” with different of two rotating
keys disks with a
Caesar Cipher
1 3 6
31
More Mathematical
32
Encryption Example:
33
Decryption Example:
34
Cryptanalysis of Caesar’s Cipher
• If it is known that a Given the intercepted ciphertext ”ILYHDP”
shift cipher has been
used, but the key is +1
I
J
L
M
Y
Z
H
I
D
E
P
Q
unknown: +2
+3
K
L
N
O
A
B
J
K
F
G
R
S
◦ The main weakness: Only +4 M P C L H T
limited number of 25 …
+17
…
Z
…
C
…
P
…
Y
…
U
…
G
possible keys +18 A D Q Z V H
+19 B E R A W I
◦ Fairly simple to break the +20 C F S B X J
code by a simple brute force +21 D G T C Y K
attack +22
+23
E
F
H
I
U
V
D
E
Z
A
L
M
+24 G J W F B N
+25 H K X G C O
35
Substitution Cipher
36
Substitution Cipher
• Adding more complexity: Substituting each plaintext
character by a fixed jumbled other character
• Much easier to remember when using leading keyword
compared to a random jumble of 26 characters
• An example key: warlordz
◦ plaintext: abcdefghijklmnopqrstuvwxyz
◦ ciphertext: warlodzbcefghijkmnpqstuvxy
• Encryption example:
◦ plaintext : defend the east wall of the castle
◦ ciphertext: lodoil qbo owpq uwgg jd qbo rwpqgo
37
Let’s solve it!
• Here is a secret message bkfgamdazje. Decode it using
paper and pencil. (hint a=o, e=s)
38
Brute-Force Attack: Letter Frequency
Analysis
• Letters have very different
frequencies in the English
language Letter frequencies in English
Frequency in%
8.000
6.000
4.000
2.000
•
0
39
Breaking the Substitution Cipher with Letter Frequency
Attack
• Let‘s solve the ciphertext with the most frequent letters:
yvn xct ck hoxtynl cw htwqhnm, jt
In T C H N W X Y , J K L M O Q V
Count 4 3 3 3 2 2 2 1 1 1 1 1 1 1 1
40
Let’s solve it!
rtpgld vmpjr vzp svm, sfa dapkzlq tqar z bgnfap kzbfgla
bzjjar sfa algdkz. gs bmtjr qalr zlr pabagua kaqqzdaq
otgbijx zlr qabpasjx.
41
Secure Sockets Layer/Transport Layer
Security (SSL/TLS)
• TLS was developed from SSL
• Works in between Application and Transport layer
• HTTPS (TCP port 443), IMAPS, POPS
• Symmetric key, Asymmetric key
• Digital certificate issued by Certificate authority (CA)
42
Basic Encryption
https://blog.cloudhm.co.th/what-is-ssl-and-tls/
43
Symmetric vs Asymmetric
44
Symmetric: Limitations
• Key distribution problem:
◦ Require mechanisms to securely pass the key
◦ Potential for eavesdropping
◦ Key Management n(n-1)/2
45
Comparison
Embedded System design with implementation of a cryptographic algorithm for the development of Nadjibi's Pay As You Go platform
46
SSL/TLS Explanation
47
PGP (Pretty Good Privacy)
48
ปกป้องข้อมูลเบื้องต้น
• เปิดโหมดใช้งานไม่ระบุตัวตน (Incognito Mode)
• ใช้ Search Engine ที่รักษาความเป็นส่วนตัว
◦ Ex. Duckduckgo
• ตั้งรหัสผ่านที่ปลอดภัย
◦ อย่างน้อย 8 ตัวอักษร
◦ รหัสผ่านต้องไม่ใช่คําที่อยู่ใน Dictionary
◦ ไม่ควรใช้รหัสเดียวกันทุกระบบ
◦ ไม่ควรใช้คําซํ้า
◦ Admin ควรกําหนดอายุรหัสผ่าน
49
2 Factor Authentication (or more)
• Factors
◦ Something you know (such as a password)
◦ Something you have (such as a smart card)
◦ Something you are (such as a fingerprint)
◦ Something you do (such as making a signature)
◦ Somewhere you are (such as using a mobile device with
location services
• Single-factor and multifactor systems
◦ Two-factor
◦ Multifactor
50
Something You Have
• Smart card or token-based access
• Digital cerfificates
• Card readers (Contact-based, less)
• One-time password (OTPs)
51
Something You Are
• Something you are:
◦ Fingerprint patterns, iris or retina recognition, or facial
recognition
• Something you do:
◦ Behavioral recognition
52
Somewhere You Are
• Geographic location or logical network address
• Global Positioning System (GPS), Indoor Positioning
System (IPS)
53
หายนะทางไซเบอร์
สายการบินระดับชาติ (มิ.ย. 2018)
• หน้า Website มีการเปลี่ยนแปลง เส้นทางไป
Website หลอก
• ข้อมูลรั่วลูกค้ารั่วประมาณ 500,000 ราย
• ชื่อ, นามสกุล, เลขบัตรเครดิต, CVV
• The Information Commissioner’s Office: ICO
• เกิดหลังจากประกาศ GDPR (25 พ.ค. 2018)
• ค่าปรับ £183m (7,500 ล้านบาท)
55
โรงแรมขนาดใหญ่ (ม.ค. 2020)
• 2016 เกิดการเข้าซื้อกิจการในเครือโรงแรม
มูลค่า 13.6 พันล้านดอลลาร์
• โรงแรมเก็บข้อมูลบัตรเครดิต, ข้อมูลเข้าพัก
• แท้จริงแล้ว ระบบจองที่พักโดนเจาะตั้งแต่ปี
2014
• ข้อมูลแขกที่เข้าพักในเครือกว่า 500 ล้านราย
• ICO แจ้งค่าปรับ £99m (4 พันล้านบาท)
56
Google ละเมิดข้อมูลส่วนตัว
• เหตุการณ์ที่ 1 – GDPR ปรับ 50 ล้านยูโร
◦ ขอคํายินยอมที่ไม่ชัดเจนพอ ไม่ได้บอกว่าข้อมูลที่ขอ จะเอาไปใช้กับบริการใด
ของ Google บ้าง
57
Uber ถูกเจาะระบบ (2017)
• สั่งปรับ 148 ล้าน USD
• จงใจปิดข้อมูลที่บริษัทโดนเจาะระบบ
• โดนเจาะปี 2016 ขโมยข้อมูลลูกค้าและผู้ขับรถ
57 ล้านราย
• Bloomberg รายงานว่า Hacker 2 คน เข้าถึง
Github source code
• Uber ยอมจ่ายเงิน 100,000 USD ให้แก่
Hacker เพื่อกู้ข้อมูลกลับมา และห้ามเผยแพร่ต่อ
สาธารณะ
• แจ้งต่อลูกค้าช้ามาก (1 ปีหลังจากถูกเจาะ)
58
Twitter ทําข้อมูลหลุด
• คณะกรรมการคุ้มครองข้อมูลส่วนบุคคลของ
Ireland สั่งปรับ 550K USD
• เกิดจาก Bug ของ Twitter บน Android ทําให้
ข้อความกลายเป็น Public
• นอกจากนี้ ไม่แจ้งเหตุระเมิดภายใน 72 ชั่วโมง
ผิด GDPR มาตรา 33 (1) ซึ่งเท่ากับ PDPA
มาตรา 37 (4) ของไทย
59
หมอชนะ (Privacy or Security)
• Contact Tracing
• การคุ้มครองข้อมูลส่วนบุคคล (Personal Data
Protection)
• หมอชนะเก็บข้อมูลขึ้น AWS
• เหตุการณ์ส่วนใหญ่เกิดจากการตั้งค่าผิด
• เอาข้อมูลของเราไปทําอะไร ?
60
กรุงไทย AXA
• แฮกเกอร์ Avaddon ประกาศว่าขโมย
ข้อมูลลูกค้ากลุ่มประกันสุขภาพ
• ข้อมูลการยื่นเคลมประกัน (ไทย, มาเลเซีย,
ฮ่องกง, ฟิลิปปินส์)
• Inter Partners Assistance (IPA) เป็น
บริษัทให้ความช่วยเหลือรถเสีย หรือ
ช่วยเหลือด้านสุขภาพ ในประเทศไทยถูก
แฮก
• ต้องให้ความร่วมมือภายใน 240 ชั่วโมง
หากไม่ร่วมมือจะเปิดเผยเอกสารออกมา
61
ค่ายมือถือทําข้อมูลลูกค้าหลุด
• เมษายน 2018 เจ้าหน้าที่ตั้งค่า AWS S3
ผิดพลาด ข้อมูลลูกค้าหลุดกว่า 46,000
ราย
• Niall Merrigan เป็นผู้แจ้ง และพบว่าเก็บ
บัตรประชาชนสแกนไว้ใน S3 โดยไม่มีการ
รักษาความปลอดภัยใดๆ (ดาวน์โหลดได้
โดยใช้ URL)
• S3 ถูกตั้งค่าเป็น Public (Default คือ
Private)
• PDPA ยังไม่ถูกใช้ในขณะนั้น
62
Many more..
63
References
64