KangMoo
    • 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
    • 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

      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
    • Note Insights New
    • 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 Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
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
  • 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

    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
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 암호화 정보나 데이터를 알아보기 어려운 형태로 변환하는 과정 ## 암호화 방식과 알고리즘 ![](https://i.imgur.com/m89XXtr.png) - 대칭 암호화 : 암호화와 복호화에 같은 암호키를 사용하는 방식 - 비대칭 암호화 : 암호화와 복호화에 서로 다른 암호키를 사용하는 방식 - 혼합방식 암호화 : 암호화와 비대칭 암호화를 함께 사용하는 방식 ## 대칭 암호화 - 암호화와 복호화에 같은 키를 사용하는 암호화 방식 - 암호화를 수행할 때 사용한 키를 복호화에도 사용하여 데이터를 원래의 평문으로 복원한다. - 대칭 암호화에서는 키의 비밀성이 중요하다. - 키를 알지 못하는 사람은 암호화된 데이터를 해독할 수 없기 때문 - 대칭 암호화에서는 안전한 방법으로 키를 교환하고, 키의 보안성을 유지해야 한다 - 대표적인 대칭 암호화 알고리즘 : DES(Data Encryption Standard), 3DES(Triple Data Encryption Standard), AES(Advanced Encryption Standard) 등이 있다. ## 비대칭 암호화 - 암호화와 복호화에 서로 다른 키를 사용하는 암호화 방식 - 키를 안전하게 교환할 수 있으며, 키 관리와 보호 등에 대한 문제점을 해결하기 위한 방법으로 사용된다 - 대칭 암호화 방식보다 계산량이 많아서, 대규모 데이터 처리에는 적합하지 않을 수 있다. - **대칭 암호화에 비해 느리다** - 비대칭 암호화에서는 공개키와 개인키를 사용한다. - 공개키는 누구나 사용할 수 있으며, 개인키는 키 소유자만이 사용할 수 있다. - 암호화를 수행할 때는 공개키로 암호화하고, 복호화를 수행할 때는 개인키로 복호화한다. - 대표적인 비대칭 암호화 알고리즘으로는 RSA(Rivest-Shamir-Adleman)가 있다. ![](https://i.imgur.com/L07yv7Q.png) > 대칭키 암호화 vs 비대칭키 암호화 > > ![](https://i.imgur.com/8WFnZtR.png) ### 비대칭 암호화는 언제, 어떻게 사용되는가? - 데이터 무결성 - 암호화된 데이터는 권한이 없는 타인에 의해 수정될 수 없다 - 변조 여부는 해싱으로 확인하지만 암호화는 아예 변조를 못하게 막는 개념 - 데이터 보호 - 암호화된 데이터는 권한이 없는 타인에 의해 읽힐 수 없다 - 인증(Authentication) - 특정 데이터에 접근이 가능한 사용자인지 확인하는 과정 > ![](https://i.imgur.com/YCLabj6.png) > > --- > > ![](https://i.imgur.com/TRMFrmM.png) ### RSA 암호화 - 비대칭 암호화로 가장 많이 사용되는 암호화 - RSA 암호화는 다음 두가지 특징을 사용해 만들어졌다 1. 소인수분해의 어려움 2. 모듈러 연산의 특징 #### RSA암호화 키 생성 방식 1. 두 개의 소수(p, q)를 선택한다. 2. N = p*q를 계산한다. 3. φ(N) = (p-1)*(q-1)을 계산한다. (φ(N)은 N보다 작은 수 중에서 N과 서로소인 수의 개수를 나타낸다.) 4. φ(N)와 서로소인 e를 선택한다. (보통 e는 65537을 사용한다.) 5. d를 계산한다. d는 e*d ≡ 1 (mod φ(N))을 만족하는 d 값이다. 여기서 ≡ 기호는 모듈러 연산을 의미한다. 6. 공개키는 (e, N)이다. 개인키는 (d, N)이다. #### RSA 암호화 암/복호화 공식 암호화 : C ≡ M^e (mod N) 복호화 : M' ≡ C^d (mod N) - 공개키: (e, N) - 개인키: (d, N) - 원본 데이터: M - 암호화된 데이터: C - 복호화된 데이터: M' ![](https://i.imgur.com/FHQyA0k.jpg) ## 혼합방식 암호화 - 대칭 암호화와 비대칭 암호화를 조합하여 안전한 데이터 전송을 보장하는 방식 - 이 방식에서는 먼저 비대칭 암호화 방식을 사용하여 안전한 키 교환을 수행한다. 이후 데이터 전송에 대해서는 대칭 암호화 방식을 사용하여 데이터를 암호화하고 전송한다. - 혼합방식 암호화는 대칭 암호화 방식의 빠른 암호화/복호화 기능과 비대칭 암호화 방식의 안전한 키 교환을 모두 활용할 수 있어 안전한 데이터 전송을 보장할 수 있다. - 또한, 대칭 암호화 방식을 사용하기 때문에 대용량 데이터 처리에도 적합한다. - 전자상거래, 인터넷 보안, 데이터베이스 보안 등 다양한 분야에서 사용되며, 혼합방식 암호화를 사용하면 데이터의 안전성과 무결성을 보장할 수 있다. ## 해시함수를 이용한 암호화 ### 해시 함수 ![](https://i.imgur.com/6nmwBdj.png) - 해시 함수 : 임의의 길이의 데이터를 고정된 길이의 데이터로 매핑하는 함수 - 입력 데이터가 같으면 출력 데이터도 같다는 특성을 가지고 있다. - 입력 데이터가 다르면 출력 데이터도 다르다는 특성을 가지고 있다. - 해시는 예측이 불가능하다. - 입력 데이터가 조금만 달라져도 출력 데이터가 완전히 달라지는 특성을 가지고 있다. ### 해시함수로 비밀번호를 안전하게 서버에 저장하는 과정 ![](https://i.imgur.com/PoPWOIp.png) 1. 회원가입을 위해 클라이언트가 ID/PW를 전달한다 - 전달 시 PW를 해시화해서 전달한다 2. 서버가 ID와 해시화된 PW를 저장하고 회원가입 결과를 알려준다. 3. 로그인을 위해 클라이언트가 ID/PW를 전달한다 - 전달 시 PW를 해시화애서 전달한다 4. 서버가 ID와 해시화된 PW를 비교하여 일치하는지 확인 후 로그인 결과를 알려준다. ### Rainbow Table ![](https://i.imgur.com/P83leNb.png) - 함수를 사용하여 비밀번호와 같은 데이터를 빠르게 복호화하기 위한 미리 계산된 테이블 - 레인보우 테이블은 미리 계산된 해시 값과 그에 해당하는 원본 데이터를 저장하고 있어, 해시 값을 쉽게 복호화할 수 있. - 레인보우 테이블 공격은 해시 값만 알고 있는 상황에서 원래 데이터를 찾아내는 데 쓰인다 ### Salt ![](https://i.imgur.com/hLellI3.png) - Salt는 임의의 데이터로, 비밀번호와 같이 해시화 할 데이터와 함께 사용된다 - Salt는 원본 데이터에 추가되어 새로운 해시 값을 생성하며, 이렇게 함으로써 레인보우 테이블 공격의 효과를 상당히 줄일 수 있다 - 각 사용자마다 고유한 Salt 값을 사용하면, 동일한 비밀번호라도 다른 해시 값이 생성되므로 레인보우 테이블을 사용한 공격에 대한 보안을 강화할 수 있다. - Salt는 저장되어야 하는 추가 데이터이지만, 그 값어치를 하는 중요한 보안 요소

    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