IT Security 2 (Ch11~Ch12)

Chapter 11: Anonymous(匿名) Communication

:cactus: Different notions of Privacy

  • :droplet: Anonymity
    • 隱藏 執行action
    • 通常用一個 set 做匿名紀錄 action
  • :droplet: Untraceability
    • 讓執行的actions難以identify是同一個使用者
  • :droplet: Unlinkability
    • 難以連結人跟行為
  • :droplet: Unobservability
    • 隱藏items
  • :droplet: Pseudonymity
    • 用pseudonymity代替真的identity

:cactus: Broadcast

  • 達到 receiver anonymityUnobservability
  • 對訊息 加密,只有要傳遞的的 receiver 能解開

    但使用者必須對所有訊息解密才知道是否傳給自己

:cactus: Mixes

  • :droplet: Idea
    • "Untraceable electronic mail, return addresses, and digital pseudonyms"
    • Mix 是一個網路節點
      • 接受encrypted訊息
      • Decrypt訊息
        • 是否接收過
        • 得到new address
      • 蒐集訊息
        • 達到threshold數量
        • 或時間到
      • 送出訊息
        • 隨意的順序給new address

      訊息只被最多一個 mix 處理

  • 保障
    • Sender是anonymous (receiver只看到mix)
    • 攻擊者可以竊聽,但不能link sender/receiver
    • random number確保不能replay
      若能replay則攻擊者要link sender/receiver且receiver出現兩次
  • :droplet: 缺點
    • 攻擊者若能 加入traffic,則可以link sender/receiver
    • 攻擊者知道自己傳/收哪些訊息
  • :droplet: Mix Cascades
    • 加入多個mix
    • 即使攻擊者控制一個mix,還有一個mix就可以保證anonymity
    • 越多Mixes,performance越低
    • 3個通常最好(在performance跟security之間)
      • 如果3個都被攻擊者控制,攻擊者還是可以link
  • :droplet: Return addresses
    • 若receiver不知道sender的身份但要回傳訊息?
    • A 生成 兩對公私鑰
      • \(k_2\)B,加密自己的訊息給 A
      • \(k_1\)mix,加密回傳訊息
  • :droplet: Basic Mixnets的缺點
    • 高度運算 (encryption/decryption)
    • 高延遲 (store/forward nature)
    • :necktie: 挑戰: Low-latency anonymity network
      • 用 public-key建立 circuit,但 circuit 間的 hops 用 symmetric keys

:cactus: Onion Routing

  • :droplet: 定義
    • 基於 mixes 的規則
    • real-time/ bi-directionsl
    • Initiator隨機選擇中間routers (由不同administrative控制)
    • hybrid encryption
    • anonymity是optional
    • Main emphasis: initiator/responder 對第三方或被攻擊的onion router來說是 unlikability
  • :droplet: Operation
    • application建立socket連線到application proxy
    • application proxy跟onion proxy建立連線
    • :steam_locomotive: Connection Setup
      • Router interconnection
        • 長期的socket連線
        • application layer
        • 用symmetric keys
      • initiator
        • Onion: 連線路徑recursively
        • 每個 onion router 只知道前一個跟下一個
        • Alice要送訊息要經過每個router都要用router public key層層加密
        • 經過每個router層層解密之後傳給Bob

:cactus: Garlic Routing

  • Onion routing 相似
  • 但一個 garlic message 可以有 multiple data (cloves)
  • 和 garlic router 建立 inbound 和 outbound tunnel

可以像 onion routing一樣經過多個router
最後分散cloves給不同的receiver
同個receiver的多個cloves也可變成garlic message,經過多個router再給receiver

:cactus: Dining Cryptographers

  • perfectly untraceable
  • Dining Cryptographers problem: 無條件 sender/recipient untraceability
  • 保障 information-theoretic anonymity
    • 強烈假設,對抗有無限計算資源的攻擊者
  • 難以實行
  • :droplet: Three-person DC Protocol
    • 目標: 知道NSA是否付錢,或是其他兩人是否付錢但匿名
    • 解法:
      • 每個人擲銅板並給下一個人看
      • 每個人說自己的跟上一個人的是否相同
        • 但如果有付錢,則說謊
      • 基數個「相同」: NSA有付錢
        偶數個「相同」: 其他人付錢

      其他人如果不知道銅板內容,無法知道是誰付錢

    • 證明:
      • XOR
        \(x_1\oplus x_2\oplus x_2\oplus x_3\oplus x_3\oplus x_1 = 0\) 如果沒有人說謊的話
    • 推廣到 \(N\) 個人
      • 每個人產生一random bit
      • 給下一個人
      • 每個人計算自己和上一個人的bit的 XOR
    • 難以執行
      • 溝通需要secure
      • 大量communication和randomness
    • 若有人 collude 仍 robust

:cactus: Tor

  • 第二代 onion routing network

  • Features:

    • 主要提供 sender anonymity
    • directory servers (trusted nodes)
    • Integrity 保障
    • 建立 rendezvous point(會合點) 和 hidden service
  • :droplet: Circuit Setup

    • 從 trusted directory server 取得 onion routers 的 list
    • 從 list 中隨機選3個
    • 但router #1建立 symmetric key 及circuit
    • 經過router #1和router #2建立 symmetric key
    • router #3 是exit node

    3個onion router是對performance和security的折衷

  • :droplet: Key Establishment

    • Diffie-Hellman key agreement
    • TLS
    • relay: 接力
  • :droplet: Opening Streams (OP)

    • Alice想建立TCP連線
    • 詢問 OP (via SOCKS)
    • OP 選擇 最新的 open circuit或創造一個
  • :droplet: Management

    • 多個applications可以 共用 一個circuit
    • Tor router沒有root權限
      • 越多TCP streams,越有匿名性
    • Directory servers
      • 控制 new routers 如何加入
      • Sybil attack 攻擊者產生過多 routers
  • :droplet: warning

    • Tor沒有 EncryptIntegrity protect
      • 除非application提供
    • 有些application resolve(解析) the host name to its IP address
      • DNS request與Tor's purpose相悖
    • 不能阻止authorities/ network providers的censorship(審查制住)
      • 使用者/ router可能被 block
      • router list也可以被所有使用者知道

      不影響privacy但影響 usage

  • :droplet: Directory server

    • 儲存node state/ keys/ exit policies
    • acts as an HTTP server
      • Onion routers(ORs) 更新 signed statements給 server
      • Directory server 檢查
  • :droplet: Location Hidden Service

    • 目標:
      • 任何人都可連線但不知道在哪/是誰
      • Resistant to Censorship
      • Resistant to flooding attack/ physical attack
    • Idea:
      • Hidden Server 選擇 introduction points (list) ,並給directory server
      • Client 從 directory server 隨機選 rendezvous point 告訴 server,並透過 introduction points 連到 rendezvous point
      • 用 TOR circuit 達到 anonymity
    • Creating a Location Hidden Service
    • Using a Location Hidden Service
  • :droplet: Attacker Types

    • :bat: Routing Attack
      • 利用 Tor's preferential routing 機制
      • Tor 高機率會選擇 high-bandwith, high-uptime 的 routers
      • 攻擊者創造一個 "preferred routers" 使 Tor 選擇
      • 即使攻擊者的 router with low-resource,還是可能成功攻擊
        因為 Tor 的 information 只由 node 本身提供
        攻擊者可以偽造 uptime/ bandwidth
      • 攻擊者可以控制 router 並取得 path 資訊
        • 可以知道是entry/ middle/ exit node
        • timestamp
        • previous circuit ID/ onion router's IP address/ port
        • next circuit ID/ onion router's IP address/ port
      • 攻擊者傳送這些 logs 給 central authority (想要 link 這些 information 的人)
        • 如果 node 收到 request 沒有在 directories list 上,則此 node 為 entrance node
      • central authority 分析 sender/ receiver
    • :bat: Cell Counters
      • 利用entry/exit node delay cells send out
      • 攻擊者若控制 entry/ exit node,可以 delay 送出資訊
      • 攻擊者 flushing down 3 cells
    • :bat: Fingerprinting
      • 攻擊者知道從網路上下載的身分 (eg. URL)
      • 可以觀察 onion proxy 的 traffic,知道前一個 fingerprinted website
      • Scenario 1:
        • 攻擊者分類使用者access哪個website
      • Scenario 2
        • 固定website分析使用者是否access
      • 解法:
        • Padding
        • Morphing
          • random ad blockers,隨機block網頁中的檔案
          • 同時loading多個頁面

:cactus: I2P

  • :droplet: Overview
    • I2P = Invisible Internet Project
    • message-oriented
    • peer-to-peer
      • 每個 user run I2P router
    • inside the network
    • garlic routing
  • :droplet: netDB
    • 有 contact information
    • 基於 flood-fill peers 管理的 distributed hash table
    • netDB存有
      • RouterInfo peer的資訊
      • LeaseSet 如何找到 internal service(destination) (lease: entry points)
    • Clients 透過 exploratory tunnels 連線 flood-fill peers
  • :droplet: Tunnel Establishment
    • 決定 I2P peer 的順序
    • 傳送 tunnel construction request 給第一個 peer
    • 每一層加入 symmetric key 並傳給下個 peer
    • 回傳回應並在經過每個 peer 時加密
  • :droplet: 如何決定 peer?
    • 用 peer profiling 分類peers 成為 tiers
    • 監測 peers的 performance
    • 每30秒 profiles 被排序到 3 個tiers
    • Fast tier: Client tunnnels
    • High-capacity tier: exploratory tunnels
  • :droplet: Comparison
Tor I2P
Optimized and designed for exit traffic 需要 out-proxy for exit traffic
SOCKS (TCP) I2P API (TCP/UDP)
onion routing garlic routing
沒有encyption end-to-end encryption如果service在I2P裡
較快 較慢

Chapter 12: Digital Cash and Bitcoin

:cactus: Money

  • Commodity money
    • salt, gold, silver
  • Commodity standard
    • tokens (paper notes) of gold and silver
  • Fiat money
    • tokens have value decared by government
  • Electronic money
    • electronic representation of money

:cactus: E-cash

  • Naive approach
    • \((\text{value},sig_{bank}(\text{value}))\)
    • :film_projector: Problem 1: Double spending
      • serial number (sn)
      • \((\text{sn, value},sig_{bank}(\text{sn, value}))\)
      • bank maintain sn 的database
      • 只有沒有被 deposit 過的錢可以被 deposit
    • :film_projector: Problem 2: increasing database
      • expiration time (exp)
      • \((\text{sn, value, exp},sig_{bank}(\text{sn, value, exp}))\)
    • :film_projector: Problem 3: traceability
      • bank可以透過 sn link user/merchant
      • Blind RSA signatures
        • \(h=\text{H(sn,value,exp)}\)
        • user 選擇一個 random number \(r\)
        • user 給 bank \(h\cdot r^e \text{ mod } n\)
        • bank 簽章 \(h^d \cdot r \text{ mod } n\)
        • user 計算 \(h^d\cdot r\cdot r^{-1}\text{ mod } n\)
        • 即得到 bank 的數位簽章 \(h^d\text{ mod } n\)

        bank 無法link \(h^d \cdot r\)\(h^d\)

    • :film_projector: Problem 4: how much the user pay
      • bank 用不同的 key 簽章
    • 其他機制:
      • 使用者要對 bank 認證自己

:cactus: Bitcoin

  • :droplet: Motivation
    • 沒有bank/ government
    • 沒有transaction cost,適合micropayments
    • anonymous payment
  • :droplet: Address
    • Address 是 public key 的 Hash
  • :droplet: Transactions
    • 對前一個交易的 output address (public key) 簽章以 authorize

      前一筆交易只有擁有 private key 的人能用

  • :droplet: Wallet
    • 有 private key/ public key pairs
    • 有 private key 就能花錢
  • :droplet: Transaction Verification
    • double spending
    • 沒有 bank 可以驗證這筆錢只花了一次
    • Proof of Work
      • 找到nonce
  • :droplet: Blocks
    • transactions 的 collections
    • 三種type
      • in the main chain
      • in a side branch
      • orphan(孤兒) blocks: 沒有前一個 block
  • Merkle root
    • 所有 transactions 的 hash
    • 要驗證某筆交易是不是在 block 中,不需要下載所有交易
      只需要有跟這筆交易計算到 hash 的交易就可以
  • :droplet: Block Verification
    • 每個 transaction 被廣播
    • peer 蒐集 transaction
    • 驗證每個 transaction 的
      • 簽章
      • 輸入等於輸出
      • 前一筆交易是否在 main chain 中
    • 集合每個驗證的 transactions
    • 加入Tx0和自己的output address
    • 計算 nonce
    • 公開 nonce 和 hash 值
  • :droplet: Incentives
    • mining (驗證 block 的獎勵)
      • 透過 Tx0 得到
    • transaction fee (optionally)
      • 不直接定義
      • input - output
      • 透過 Tx0 傳給自己 的address
  • :droplet: Double spending
    1. 兩個transaction在同個block: 會立刻被檢查到
    2. 在不同個block: 一個已經在main chain上,另一個就不能再接下去
  • :droplet: Fast transaction
    • 通常要經過 6 個 block 後,才會被認為此 block 在 main chain 上

    bitcoin 不適合 fast transaction

  • :droplet: Anonymity
    • 製造多個地址,如果 address 和 identity 被連起來的話才不容易被知道
    • Problem: 如何被 customers 辨別多個地址是同個人
    • Problem: 如果要花錢要 link 兩個 addresses
  • Bitcoin 沒有提供 unlinkability
    • :socks: Linking with Multiple input transactions
      • 多個同個使用者的input
    • :socks: Linking with the help of Change to Own Address
      • input: address 0
        output: address 1, address 2
      • address 0 必屬於 1 或 2
    • :socks: Linking with real identity
      • 購買 bitcoin 通常會要真實 identity (with vendor/ exchange)
    • :pretzel: Protecting against de-anonymization
      • 用 Mixes
        • :one: Online wallet
          • 與 wallet 進行交易
          • 大家只會看到 wallet 的交易
          • 但會向 wallet 透露 identity
        • :two: Dedicated mixing service
          • 不要求identity
          • 送 bitcoin 給 mixing addresses
          • 再告訴 mix 要送到哪個 address
        • :three: CoinJoin
          • Decentralized mixing
          • users 共同創造一個 transaction
          • 只簽章自己的 transaction
          • 步驟:
            • 找到誰要 mix
            • 交換 input/ output
            • 創造 transaction
            • 每個人簽章自己的交易
            • 送到Bitcoin
Select a repo