Wire Lab 讀書會
  • NEW!
    NEW!  Connect Ideas Across Notes
    Save time and share insights. With Paragraph Citation, you can quote others’ work with source info built in. If someone cites your note, you’ll see a card showing where it’s used—bringing notes closer together.
    Got it
        • 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
          • Owners
          • Signed-in users
          • Everyone
          Owners Signed-in users Everyone
        • Write
          • Owners
          • Signed-in users
          • Everyone
          Owners Signed-in users Everyone
        • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invite by email
        Invitee

        This note has no invitees

      • Publish Note

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

        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.

        Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

        Explore these features while you wait
        Complete general settings
        Bookmark and like published notes
        Write a few more notes
        Complete general settings
        Write a few more notes
        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
      • Note Insights New
      • Engagement control
      • Make a copy
      • Transfer ownership
      • Delete this note
      • Insert from template
      • Import from
        • Dropbox
        • Google Drive
        • Gist
        • Clipboard
      • Export to
        • Dropbox
        • Google Drive
        • Gist
      • Download
        • Markdown
        • HTML
        • Raw HTML
    Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
    Menu
    Options
    Engagement control Make a copy 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
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Write
    Owners
    • Owners
    • Signed-in users
    • Everyone
    Owners Signed-in users Everyone
    Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

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

    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.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 蔡瀚興-讀書會-21/07/21 ## <font color="ff0000">推薦連結</font> - [What is the difference between "partial native" and "full native "](https://www.queryhome.com/tech/116405/difference-between-partial-native-native-security-context) ## <font color="FF0000">Introduction</font> ![](https://i.imgur.com/pM6vqKF.jpg) - **NAS security:** Ensure that the control plane NAS messages between the UE and the MME are safe by $K_{ASME}$. - **AS security:** The purpose of AS security is to ensure that control plane RRC messages and user plane IP data packets between the UE and eNB are safe. ## <font color="FF0000">NAS security</font> ### <font color="0000ff">一、Transmission of Security Mode Command message</font> (Assuming that MME assigns KSI-ASME = 1 to identify $K_{ASME}$.) ![](https://i.imgur.com/rfFFWOn.jpg) 1. **[MME] Select the security algorithm:** MME透過UE傳來的 Attach Request Message 中 network capability info 來選擇encryption 及 integrity algorithm 2. **[MME]Calculates the NAS security key:** MME使用 Alg-ID 和 algorithm discriminator(用來選擇安全算法) 來從$K_{ASME}$中計算出$K_{NASinc}$和$K_{NASenc}$ ![](https://i.imgur.com/psQftWf.jpg) 3. **[MME] Generate NAS-MAC for integrity protection:** MME使用EIA algo及參數算出 NAS-MAC。 (參數如下:) **1.Count :** 32bit downlink NAS count **2.Message :** NAS message, here is Security Mode Command **3.Direction:** 1bit ,0up or 1down **4.Bearer :** 5bit bearer ID, fixed value, set to 0 **5.$K_{NASinc}$ :** 128-bit NAS integrity key 4. **[UE <-MME] Sends a Security mode command message:** MME將包含NAS-MAC的Security Mode Command Message給UE,有intergirty,無enryption (訊息包含:) **1.KSI-ASME:** 3bit and K-ASME associated value **2.Return to UE security capabilities:** UE network capabilities **3.NAS encryption algorithm:** NAS encryption algorithm selected by MME **4.NAS integrity algorithm:** NAS integrity algorithm selected by MME 5. **[UE] Set $K_{ASME}$ representation (KSI-ASME):** UE將KSI-ASME設為目前的K-ASME 6. **[UE] Generate NAS security key:** UE使用$K_{ASME}$及選擇的演算法算出$K_{NASinc}$和$K_{NASenc}$ 7. **[UE] Check the integrity of the Security mode command message:** UE用MME選的intergrity algo算出XNAS-MAC消息鑑權碼和K-NASinc。 然後比較XNAS-MAC是否與NAS-MAC相同,來確認訊息完整性。 ![](https://i.imgur.com/mr5bHcp.jpg) ### <font color="0000ff">二、Transmission of Security mode complete message</font> (Security mode complete message transmission is encrypted and integrity protected) ![](https://i.imgur.com/4p8b44x.gif) 8. **[UE] uses the selected encryption algorithm EEA1 to encrypt the message:** UE加密Security Mode Complete Message並傳給MME(由Encrypted algo及$K_{NASenc}$來加密) (參數如下:) **1.Count :** 32bit uplink NAS count **2.Length :** Length of the key stream through the encryption algorithm **3.Direction:** 1bit ,0up or 1down **4.Bearer :** 5bit bearer ID, fixed value, set to 0 **5.$K_{NASenc}$ :** 128-bit NAS integrity key 9. **[UE] Generate NAS-MAC for integrity protection:** 類似 3. 10. **[UE-> MME] Send Security Mode complete message:** UE將包含NAS-MAC的Security Mode Complete Message傳給MME,有intergirty,有enryption (此後UE及MME之間的NAS messages就安全了) 11. **[MME] Verify the integrity of the Security Mode complete message:** 類似 7. 12. **[MME] Decrypts the Security Mode complete message:** 完整性驗證成功後,MME開始解密訊息 ![](https://i.imgur.com/9LKVNX8.jpg) ### <font color="0000ff">三、After the NAS is securely established</font> 一旦NAS security建立,所有UE及MME之間的NAS Message都是encrypted及integrity保護的 - NAS消息發送前,首先加密然後完整性保護。原NAS消息首先使用K-NASenc加密然後包含K-NASint計算出來的NAS-MAC做完整性保護。 - 當接收到NAS消息,首先做完整性驗證,然後解密。首先對比使用K-NASint計算出來的XNAS-MAC和接收到的NAS-MAC對比來檢查NAS消息的完整性,接著解密得到原始的NAS消息。 ## <font color='ff0000'>AS Security</font> ### <font color="0000ff">一、Transmission of Security mode command message</font> ![](https://i.imgur.com/CX5tMgG.jpg) 1. **[MME] Calculate $K_{eNB}$ :** MME用$K_{ASME}$產生$K_{eNB}$ 2. **[eNB <-MME] Send $K_{eNB}$ :** MME透過initial context setup request message傳Attach Accept Message給UE (訊息包含:) **1.UE security capability** **2.Security key:** 256bit $K_{eNB}$ 3. **[eNB] Select the security algorithm:** 類似NAS security中 1. 4. **[eNB] Generate AS security key:** ![](https://i.imgur.com/pEl9Agt.jpg) 5. **[eNB] Generate MAC-I for integrity protection:** eNB使用EIA algo及$K_{RRCint}$算出MAC-I (參數如下:) **1.Count :** 32bit downlink PDCP count **2.Message :** RRC message, here is Security Mode Command **3.Direction:** 1bit ,0up or 1down **4.Bearer :** 5bit bearer ID, fixed value, set to 0 **5.$K_{RRCint}$ :** 128-bit NAS integrity key 6. **[UE <-eNB] sends a Security mode command message:** 類似NAS security中 4. ![](https://i.imgur.com/BxZPKr0.jpg) 7. **[UE] Identification security algorithm: EEA1, EIA1** 8. **[UE] Generate AS security key:** UE使用算法ID和算法分辨器從$K_{eNB}$中計算出$K_{RRCinc}$和$K_{RRCenc}$和$K_{UPenc}$ 9. **[UE] Check the integrity of the Security mode command message:** 比較計算出來的XMAC-I及MAC-I ### <font color="0000ff">二、Transmission of Security mode complete message</font> ![](https://i.imgur.com/koIHc37.jpg) 10. **[UE] Generate NAS-MAC for integrity protection** 11. **[UE->MME] Send Security Mode complete message** 12. **[MME] Verify the integrity of the Security Mode complete message** ### <font color="0000ff">三、After AS security is established</font> 一旦AS安全建立完成,所有UE和eNB之間的RRC Message和IP-Packet都是encrypted及integrity保護 - **不同於NAS security先確認完整性再解密,AS security是先解密再確認完整性** - IP-Packet是加密的但不進行完整性保護。IP-Packet在發送端使用K-UPenc進行加密,在接收端使用K-UPenc進行解密獲得原始的IP-Packet。 ## <font color='ff0000'>Security Context</font> - **EPS security contexts:** 在EPS entity中安全相關的資料,可產生NAS或AS security contexts - **Partial native:** 在第一個SMC前的NAS security context - **Full native:** 在第一個SMC後的NAS security context ![](https://i.imgur.com/UyemNuK.jpg) ![](https://i.imgur.com/R56vNNi.jpg)

    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
    Sign in via Google Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    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