Ya-Wen Jeng
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# 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 anonymity** 和 **Unobservability** - 對訊息 **加密**,只有要傳遞的的 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 - ![](https://i.imgur.com/fT5UR2L.png) - 越多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** - ![](https://i.imgur.com/p0hShRk.png) - 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沒有 **Encrypt** 和 **Integrity 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 ![](https://i.imgur.com/MRGvzEH.png) - Using a Location Hidden Service ![](https://i.imgur.com/Yb4E132.png) - :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

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully