One Key is kept private by the entity, and the other is made public available.
Crypto = Cipher
Hashing 雜 湊 (隨 機 ) Symmetrics 對稱 Asymmetrics 非對稱
(Private Key) (Public Key)
/ \
/ \ / \ / \
/ \ / \ / \
SHA MD5 / \ / \
Block 區 塊 鏈 Stream 串 流 RSA Diffle-Hellman
/ | \ | \ (可用 於不安全 的 加 密通 道 的 金 鑰建立 演算 法 )
/ | \ | \
DES AES BlowFish RC4 TKIP
Encryption = Encipherment
-
Hash:
雜 湊 提供 checksum ,為 訊息摘要 ,由 可 變動 長 度 之 訊息產 生 ,摘要 比 訊息簡短 ,摘要 和 訊息一起送給接收者。 -
Asym:
公開 加 密 金 鑰,擁 有 2把 金 鑰 public key & private key,,傳送 者 使用 公開 金 鑰加密 文 件 後 ,傳送 予 接收 者 ,接收 者 則 使用 私 密 金 鑰解開 加 密 文 件 。 -
Sym:
秘密 金 鑰,將 訊息安全 地 於兩個 實體 間 (傳送 者 與 接收 者 ) 往返。
Status Quo in case using Security Schematics:
-
網 站要求 使用 者 登 入 系統 時 提供 身分 證明 。(Auth & Exchange Authentication) -
使用 者 登 入 系統 狀態 在 數 分 鐘 內,伺服器 強迫 使用 者 登 出 。(setTimeout to avoid Middleman) -
某 機構 拒絕 透過 電子 郵件寄 送 機密 性 資 訊予使用 者 ,要求 使用 者 提供 身分 證明 。(Auth & Exchange Authentication) -
銀行 需要 客 戶 的 簽章,方 才 提供 提 款服務 。(Digital Signature)
-
Secuity Attacks
-
Symmetrics Encryption Algorithm
-
Encryption Arithmetics : Algebra
-
Symmetrics Encryption & Decryption
-
Traditonal Encryption & Decryption
-
Modern Encryption & Decryption
-
Symmetrics Encryption Algorithm for Stream & Block
-
Asymmetric Encryption Arithmetics : Function for congruence
-
Asymmetrics Encryption & Decryption(RSA, ECC)
-
Digital Signature for Integrity (RSA, ECC)
-
Hashing Algorithm in Exchange Authentication (omit)
ITU-T
https://www.itu.int/en/ITU-T/Pages/default.aspx
Security Attacks
Passive Active
(middle man)
snooping modification DDoS
throughput masquerading
replay
repudiation
Confidentiality Integrity Availability
機密 完 整 可用
(1) 防衛 惡意 行為 (1) 系統 中斷 影響 完 整 性 儲 存 資 訊的地方 能 讓 被 授權者 存 取
(2) 隱 藏 敏感 性 資 訊 (2) 經常 需要 更 動 且須經 授權的 資 訊
Authentication
身分 確認 資料 完 整 能 防止 遭竄改 抑 或 是重 送 攸關存 取 控 制
藉由來 源 證明 與 傳送 證明 佐 證 不可 否認 性
Encrypt Digital Certificate ACL
Security Mechanism
|----- Encrpt
|-------------Integrity
|----------------------- Digital Signature
|------------------------------------------- Authentication Exchange
|----------------------------------------------------------------------Thoughput Monitor
|-----------------------------------------------------------------------------------Router Control
|------------------------------------------------------------------------------------------------ Notarization
|-------------------------------------------------------------------------------------------------------------- ACL
modular arithmetics
@param(a, r)
a = q * n + r
|
|
V
@mod is modulo operator
@n is modulus
@r is residue
a mod n = r or a % n = r
@set og least residues modulo n
Z = { }
congruence
同 餘
It means equality in Cipher.
2 mod 10 = 2
12 mod 10 = 2
22 mod 2 = 2
residue class
x = a (mod n)
for n in range(0, 3):
[0] = { xSetmodN }
[1] = { xSetmodN }
[2] = { xSetmodN }
apply field of modulo arithmetics
Matrix & Linear Algebra
-
row matrix,
行 矩 陣 瘦長
的 矩 陣 -
col matrix,
列 矩 陣 橫 向 的 矩 陣 -
square matrix,
方 矩 陣 方形 的 矩 陣 ,使用 行列 式 det(A), det即 determinant -
residue matrix,
餘 數 矩 陣 整數 矩 陣 後 還 須運行 一 次 模 數 運算
Algebra Stucture
G R F
Group Ring Field
群 環 體
/ | | | \ | ||
/ | | | \ R=<{}, . , 2nd ops> a Ring without the ability of existence of inverse
/ | | | \ the 2nd ops matches the ability of distributivity
commutative| | | existence of inverse
closure | existence of id
associative
-
commutative,
交換 性 -
closue,
分配 性 -
associative,
可 結合 姓 -
id,
存在 單位 元素 -
inverse,
存在 反 元素 -
disbutivity,
可 分配 性 -
{}, a Group
-
. , the operator
-
2nd ops
UML
sender receiver
plaintext ----------------------------- plaintext
(Encrpto) secure tunnel (Decrpto)
encrpted file ----------------------------- encrpted file
Kerckoff's Principle
cryptanalysis,
破 密 分析 是 科學 也是藝術 :
Analysis Atack
Brute-force Attack(exhausive-key-search), statistical attack, pattern attack
|
-------------------------------------------
| | | |
ciphertext-only | | |
| known-plaintext | |
| | chosen-plaintext |
v | chosen-ciphertext
最 常 發生 但 最 難破 解 | |
V |
已 知 明文 是 最 容易 執行 的 攻擊 |
發送 者 傳送 加 密 文 件 後 又 傳送 明文 |
攻擊 者 方便 比 照 兩 文 件 做破解 分析 |
|
v
攻擊 者 選擇 明 /密 文 對
-
substitution cipher,
取 代 加 密 法 用字 母 取 代 另一 個 的 加 密 法 ,傳統 上 取 代 加 密 法 有 單 字母 以及多 字母 的 選擇 。單 字母 >-
加法 -
乘法 -
仿射
多 字母 >-
自動 金 鑰 -
playfair
-
vigenere
-
hill
-
單 次 密 碼本 -
迴轉
加 密 -
迷團
機
-
-
transposition cipher,
換 位 加 密 法 重 新 安 排 符號 順序 的 加 密 法 ,目前 的 選擇 有 : (1)無 金 鑰的換 位 加 密 、(2)有金 鑰的換 位 加 密 、(3)雙 位 換 位 加 密 。
char -> bit
modern Stream Cipher (RC4)
串 流 一次以一字元或是一位元對其串流加密,有明 文 串 流 P (pipeline)、密 文 串 流 C (ciphered stream)、金 鑰串流 K (key)。
現在 串 流 加 密 法 中 ,明文 串 流 中 的 每 個 r 位 元 字 組 使用 金 鑰串流 中 的 一 個 r 位 元 自 組 進行 加 密 ,以便產 生 密 文 串 流 中 相對 應 的 r 位 元 字 組 。
kn kn
. .
. .
. .
k1 k1
pn...p1 ---> Encrpt --- cn...c1 -- > Decrpt ---> pn...p1
modern Block Cipher (DES/ AES)
加 解 一 個 n 位 元 的 明文 區 塊 或 解 密 一 個 n 位 元 的 密 文 區 塊
倘若訊息小 於 n 位 元 ,須加 入 填 塞 位 元 ,使 其成為 n 位 元 區 塊 ;
趟若訊息大 於 n 位 元 ,則 分割 成 數 個 n 位 元 區 塊 ,
一般 n = 64 or 128 or 256 or 512。
Pln int ext ----- > Enc rpt fil
n 位 元 明文 --- K 位 元金 鑰加密 ---> n 位 元 密 文 --- K 位 元金 鑰解密 ---> 明文
Combination of Stream of Blocks
- Discrete Math
0 or 1, bool
<> or [], set or arraylist
Graphics 擁 有 較為零 散 的 結構 ,可 以舉的 例 子 例 如 FB 好 友 關係
Algebra 擁 有 有 系統 的 結構
組合
集合
圖
網 路 流量
遞迴 (可 計算 執行 多久 )
- Galois Field = Finit Field
+ | 0 1
--+----
0 | 0 1
1 | 1 0
+ | 0 1 A B
--+--------
0 | 0 1 A B
1 | 1 0 B A
A | A B 0 1
B | B A 1 0
- Prime Number
- RSA
RSA_keys_generator(){
p is prime number
q is prime number
p != q
n <- p * q
Φ (n) <- (p -1) * (q - 1)
e is in range that 1 < e < Φ (n)
d <- e^1 mod Φ (n) # Φ ?
Pub_key <- (e, n)
Priv_key <- d
return Pub_key, Priv_key
}
- Elliptic Curve Crypto,
橢圓 曲線
p is modulo
(x, y) is the point on the curve
ECC_points_generator(p, x, y){
q <- 0
while(q<p){
w <---(q*q*q + x*q +y) mod p
if(w is a perfect squre in zigma_p) then output (q, sqrt(w)) (q, - sqrt(w))
q <- q +1
}
}
- Rabin
(omit)
- ElGamal
diff-hellman
(omit)
Definition
UML
(to be continued...)