Files
build_notes_simengweb/assets/index.html-B5Rz4mmh.js
2025-11-11 21:38:22 +08:00

8 lines
29 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as m,c as e,a as n,e as l,b as s,r as p,o as i}from"./app-I9WJttm3.js";const r={};function c(o,a){const t=p("Mermaid");return i(),e("div",null,[a[0]||(a[0]=n('<h2 id="_1-密码学的定义" tabindex="-1"><a class="header-anchor" href="#_1-密码学的定义"><span>1. 密码学的定义</span></a></h2><h3 id="_1-1-基本概念" tabindex="-1"><a class="header-anchor" href="#_1-1-基本概念"><span>1.1 基本概念</span></a></h3><p><strong>密码学Cryptography</strong> 是一门研究信息安全的学科,主要关注如何在不安全的环境中实现安全通信。其核心是通过数学方法对信息进行变换,使得只有授权方能够理解信息内容。</p><h3 id="_1-2-核心目标" tabindex="-1"><a class="header-anchor" href="#_1-2-核心目标"><span>1.2 核心目标</span></a></h3><p>密码学追求以下四个主要安全目标:</p><ul><li><strong>机密性Confidentiality</strong>:确保信息只能被授权的人访问</li><li><strong>完整性Integrity</strong>:确保信息在传输过程中不被篡改</li><li><strong>认证性Authentication</strong>:确认通信双方的身份真实性</li><li><strong>不可否认性Non-repudiation</strong>:防止发送方事后否认发送过信息</li></ul><h3 id="_1-3-重要作用" tabindex="-1"><a class="header-anchor" href="#_1-3-重要作用"><span>1.3 重要作用</span></a></h3><p>密码学在现代信息安全中扮演着至关重要的角色:</p><ul><li>保护个人隐私和商业机密</li><li>确保金融交易的安全性</li><li>维护国家安全和军事通信</li><li>支撑互联网基础设施的安全运行</li></ul><h3 id="_1-4-主要应用场景" tabindex="-1"><a class="header-anchor" href="#_1-4-主要应用场景"><span>1.4 主要应用场景</span></a></h3><ul><li><strong>网络安全</strong>HTTPS、VPN、SSL/TLS协议</li><li><strong>数字身份认证</strong>:数字证书、数字签名、双因素认证</li><li><strong>区块链技术</strong>:加密货币、智能合约、分布式账本</li><li><strong>移动通信</strong>SIM卡加密、移动支付安全</li><li><strong>物联网安全</strong>:设备身份认证、数据传输加密</li></ul><h3 id="_1-5-基础概念与术语-入门" tabindex="-1"><a class="header-anchor" href="#_1-5-基础概念与术语-入门"><span>1.5 基础概念与术语(入门)</span></a></h3><p>为方便初学者快速建立直觉,先认识密码学中最核心的几个概念:</p><p><strong>明文Plaintext与密文Ciphertext</strong></p><ul><li>明文未加密的原始消息例如“HELLO”。</li><li>密文:加密后的消息,人类或未授权系统难以直接理解。</li></ul><p><strong>加密Encryption与解密Decryption</strong></p><ul><li>加密:用密钥将明文转换为密文,记为:</li></ul><p class="katex-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>C</mi><mo>=</mo><msub><mi>E</mi><mi>k</mi></msub><mo stretchy="false">(</mo><mi>P</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">C = E_k(P) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.05764em;">E</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0576em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mclose">)</span></span></span></span></span></p><ul><li>解密:用密钥将密文还原为明文,记为:</li></ul><p class="katex-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>P</mi><mo>=</mo><msub><mi>D</mi><mi>k</mi></msub><mo stretchy="false">(</mo><mi>C</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">P = D_k(C) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="mclose">)</span></span></span></span></span></p><p>其中,<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>P</mi></mrow><annotation encoding="application/x-tex">P</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span></span></span></span> 表示明文,<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>C</mi></mrow><annotation encoding="application/x-tex">C</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.07153em;">C</span></span></span></span> 表示密文,<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>k</mi></mrow><annotation encoding="application/x-tex">k</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span></span></span></span> 表示密钥,<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>E</mi></mrow><annotation encoding="application/x-tex">E</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.05764em;">E</span></span></span></span> 为加密算法,<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>D</mi></mrow><annotation encoding="application/x-tex">D</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span></span></span></span> 为解密算法。</p><p><strong>密钥Key对称密钥 vs 非对称密钥</strong></p><ul><li>对称密钥:加密和解密使用相同的密钥,速度快,但密钥分发与管理是难点。</li><li>非对称密钥(公钥密码):加密使用“公钥”,解密使用“私钥”,便于密钥分发,还能支持数字签名。</li></ul><p>对称加密流程示意(同一把密钥):</p>',24)),l(t,{code:"eJxLy8kvT85ILCpR8AniUlAIjn7aP/FlQ+OLhtZYBV1dhSd79z+fsuJp68Ynu1Y/Xd/2ctJSBW+Fp10LgGygtJ2Cc7QGkPlsWrtmLFC3M04tL5YvhmkJin7Wt/TZlG0gK7gAfgE/qw=="}),a[1]||(a[1]=s("p",null,"非对称加密流程示意(公钥/私钥):",-1)),l(t,{code:"eJxLy8kvT85ILCpR8AniUlAIjn7aP/FlQ+OLhtZYBV1dhSd79z+fsuJZ39JnU7YBxZ62rnk5aenTrgVP17cBpe0UnKM1gMxn09o1Y4G6nbFoeb68EajlxfLFMC1B0XC5WC4A+5BCKg=="}),a[2]||(a[2]=s("p",null,"在典型的 RSA 公钥体制中,还可以用一个简洁的数学表达式表示加解密:",-1)),a[3]||(a[3]=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mtable",{rowspacing:"0.25em",columnalign:"right left",columnspacing:"0em"},[s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mi",null,"c")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mo",null,"="),s("msup",null,[s("mi",null,"m"),s("mi",null,"e")]),s("mtext",null,""),s("mo",{lspace:"0.22em",rspace:"0.22em"},[s("mrow",null,[s("mi",{mathvariant:"normal"},"m"),s("mi",{mathvariant:"normal"},"o"),s("mi",{mathvariant:"normal"},"d")])]),s("mtext",null,""),s("mi",null,"n"),s("mo",{separator:"true"},",")])])])]),s("mtr",null,[s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mi",null,"m")])]),s("mtd",null,[s("mstyle",{scriptlevel:"0",displaystyle:"true"},[s("mrow",null,[s("mrow"),s("mo",null,"="),s("msup",null,[s("mi",null,"c"),s("mi",null,"d")]),s("mtext",null,""),s("mo",{lspace:"0.22em",rspace:"0.22em"},[s("mrow",null,[s("mi",{mathvariant:"normal"},"m"),s("mi",{mathvariant:"normal"},"o"),s("mi",{mathvariant:"normal"},"d")])]),s("mtext",null,""),s("mi",null,"n"),s("mo",{separator:"true"},",")])])])])]),s("annotation",{encoding:"application/x-tex"},"\\begin{aligned} c &= m^{e} \\bmod n,\\\\ m &= c^{d} \\bmod n, \\end{aligned} ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"3.0591em","vertical-align":"-1.2796em"}}),s("span",{class:"mord"},[s("span",{class:"mtable"},[s("span",{class:"col-align-r"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.7796em"}},[s("span",{style:{top:"-3.9396em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"c")])]),s("span",{style:{top:"-2.3804em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"m")])])]),s("span",{class:"vlist-s"},"")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.2796em"}},[s("span")])])])]),s("span",{class:"col-align-l"},[s("span",{class:"vlist-t vlist-t2"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.7796em"}},[s("span",{style:{top:"-3.9396em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"m"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7144em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mathnormal mtight"},"e")])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.0556em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},[s("span",{class:"mord"},[s("span",{class:"mord mathrm"},"mod")])]),s("span",{class:"mspace",style:{"margin-right":"0.0556em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mpunct"},",")])]),s("span",{style:{top:"-2.3804em"}},[s("span",{class:"pstrut",style:{height:"3em"}}),s("span",{class:"mord"},[s("span",{class:"mord"}),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"c"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8991em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mathnormal mtight"},"d")])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.0556em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},[s("span",{class:"mord"},[s("span",{class:"mord mathrm"},"mod")])]),s("span",{class:"mspace",style:{"margin-right":"0.0556em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mpunct"},",")])])]),s("span",{class:"vlist-s"},"")]),s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"1.2796em"}},[s("span")])])])])])])])])])])],-1)),a[4]||(a[4]=n('<p>其中 <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>e</mi><mo separator="true">,</mo><mi>n</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(e, n)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">e</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">n</span><span class="mclose">)</span></span></span></span> 为公钥,<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>d</mi><mo separator="true">,</mo><mi>n</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(d, n)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal">d</span><span class="mpunct">,</span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal">n</span><span class="mclose">)</span></span></span></span> 为私钥,<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>m</mi></mrow><annotation encoding="application/x-tex">m</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">m</span></span></span></span> 为明文,<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>c</mi></mrow><annotation encoding="application/x-tex">c</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.4306em;"></span><span class="mord mathnormal">c</span></span></span></span> 为密文。</p><p><strong>常见攻击模型简介(只需直观理解)</strong></p><ul><li>唯密文攻击COA攻击者只有密文尝试恢复明文或密钥。</li><li>已知明文攻击KPA攻击者拥有部分“明文-密文”对,用于分析算法或密钥。</li><li>选择明文攻击CPA攻击者可选择明文并获取其密文用于推断密钥或算法结构。</li><li>选择密文攻击CCA攻击者可选择密文并得到其解密结果进一步分析系统弱点。</li></ul><p>直观结论:设计良好的现代密码系统,应当在这些攻击模型下仍保持安全(在合理的参数与假设下)。</p><h2 id="_2-密码学历史简述" tabindex="-1"><a class="header-anchor" href="#_2-密码学历史简述"><span>2. 密码学历史简述</span></a></h2><h3 id="_2-1-古代密码学-公元前-15世纪" tabindex="-1"><a class="header-anchor" href="#_2-1-古代密码学-公元前-15世纪"><span>2.1 古代密码学(公元前-15世纪</span></a></h3><p><strong>凯撒密码Caesar Cipher</strong></p><ul><li>时间公元前1世纪</li><li>原理:字母移位加密</li><li>示例将字母向后移动3位A→DB→E</li></ul><p><strong>斯巴达密码棒Scytale</strong></p><ul><li>时间公元前5世纪</li><li>原理:缠绕在特定直径木棒上的皮条</li></ul><p>古典密码简述:</p><ul><li>核心思路:替换或移位(重新排列)字符。</li><li>代表示例:凯撒(替换)、栅栏(移位)、维吉尼亚(多表替换)。</li><li>直觉目标:混淆结构、增加猜测难度;但易受频率分析。</li></ul><h3 id="_2-2-文艺复兴时期-15-18世纪" tabindex="-1"><a class="header-anchor" href="#_2-2-文艺复兴时期-15-18世纪"><span>2.2 文艺复兴时期15-18世纪</span></a></h3><p><strong>维吉尼亚密码Vigenère Cipher</strong></p><ul><li>时间16世纪</li><li>原理:多表替换密码</li><li>特点:比单表替换更安全</li></ul><p><strong>博福特密码Beaufort Cipher</strong></p><ul><li>时间18世纪</li><li>原理:改进的维吉尼亚密码</li></ul><h3 id="_2-3-近代密码学-19-20世纪中期" tabindex="-1"><a class="header-anchor" href="#_2-3-近代密码学-19-20世纪中期"><span>2.3 近代密码学19-20世纪中期</span></a></h3><p><strong>恩尼格玛密码机Enigma</strong></p><ul><li>时间:二战时期</li><li>原理:机械转子密码机</li><li>重要性:推动了现代密码分析的发展</li></ul><p><strong>香农的信息论</strong></p><ul><li>时间1949年</li><li>贡献:为密码学奠定了数学理论基础</li></ul><h3 id="_2-4-现代密码学-1970年代至今" tabindex="-1"><a class="header-anchor" href="#_2-4-现代密码学-1970年代至今"><span>2.4 现代密码学1970年代至今</span></a></h3><p><strong>DES算法</strong></p><ul><li>时间1977年</li><li>意义:第一个公开的加密标准</li></ul><p><strong>RSA算法</strong></p><ul><li>时间1977年</li><li>意义:第一个实用的公钥密码系统</li></ul><p><strong>AES算法</strong></p><ul><li>时间2001年</li><li>意义取代DES的新一代加密标准</li></ul><p>现代密码简述:</p><ul><li>对称加密同一密钥加解密适合大量数据示例AES/DES/3DES。</li></ul><p class="katex-block"><span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>C</mi><mo>=</mo><msub><mi>E</mi><mi>k</mi></msub><mo stretchy="false">(</mo><mi>P</mi><mo stretchy="false">)</mo><mo separator="true">,</mo><mspace width="1em"></mspace><mi>P</mi><mo>=</mo><msub><mi>D</mi><mi>k</mi></msub><mo stretchy="false">(</mo><mi>C</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">C = E_k(P), \\quad P = D_k(C) </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6833em;"></span><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.05764em;">E</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0576em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mclose">)</span><span class="mpunct">,</span><span class="mspace" style="margin-right:1em;"></span><span class="mspace" style="margin-right:0.1667em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">P</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.02778em;">D</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3361em;"><span style="top:-2.55em;margin-left:-0.0278em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.03148em;">k</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.07153em;">C</span><span class="mclose">)</span></span></span></span></span></p><ul><li>非对称加密公钥加密、私钥解密便于密钥分发与数字签名示例RSA/ECC。</li></ul>',33)),a[5]||(a[5]=s("p",{class:"katex-block"},[s("span",{class:"katex-display"},[s("span",{class:"katex"},[s("span",{class:"katex-mathml"},[s("math",{xmlns:"http://www.w3.org/1998/Math/MathML",display:"block"},[s("semantics",null,[s("mrow",null,[s("mi",null,"c"),s("mo",null,"="),s("msup",null,[s("mi",null,"m"),s("mi",null,"e")]),s("mtext",null,""),s("mo",{lspace:"0.22em",rspace:"0.22em"},[s("mrow",null,[s("mi",{mathvariant:"normal"},"m"),s("mi",{mathvariant:"normal"},"o"),s("mi",{mathvariant:"normal"},"d")])]),s("mtext",null,""),s("mi",null,"n"),s("mo",{separator:"true"},","),s("mspace",{width:"1em"}),s("mi",null,"m"),s("mo",null,"="),s("msup",null,[s("mi",null,"c"),s("mi",null,"d")]),s("mtext",null,""),s("mo",{lspace:"0.22em",rspace:"0.22em"},[s("mrow",null,[s("mi",{mathvariant:"normal"},"m"),s("mi",{mathvariant:"normal"},"o"),s("mi",{mathvariant:"normal"},"d")])]),s("mtext",null,""),s("mi",null,"n")]),s("annotation",{encoding:"application/x-tex"},"c = m^{e} \\bmod n, \\quad m = c^{d} \\bmod n ")])])]),s("span",{class:"katex-html","aria-hidden":"true"},[s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"c"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.7144em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"m"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.7144em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mathnormal mtight"},"e")])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.0556em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},[s("span",{class:"mord"},[s("span",{class:"mord mathrm"},"mod")])]),s("span",{class:"mspace",style:{"margin-right":"0.0556em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.625em","vertical-align":"-0.1944em"}}),s("span",{class:"mord mathnormal"},"n"),s("span",{class:"mpunct"},","),s("span",{class:"mspace",style:{"margin-right":"1em"}}),s("span",{class:"mspace",style:{"margin-right":"0.1667em"}}),s("span",{class:"mord mathnormal"},"m"),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}}),s("span",{class:"mrel"},"="),s("span",{class:"mspace",style:{"margin-right":"0.2778em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.8991em"}}),s("span",{class:"mord"},[s("span",{class:"mord mathnormal"},"c"),s("span",{class:"msupsub"},[s("span",{class:"vlist-t"},[s("span",{class:"vlist-r"},[s("span",{class:"vlist",style:{height:"0.8991em"}},[s("span",{style:{top:"-3.113em","margin-right":"0.05em"}},[s("span",{class:"pstrut",style:{height:"2.7em"}}),s("span",{class:"sizing reset-size6 size3 mtight"},[s("span",{class:"mord mtight"},[s("span",{class:"mord mathnormal mtight"},"d")])])])])])])])]),s("span",{class:"mspace",style:{"margin-right":"0.0556em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}}),s("span",{class:"mbin"},[s("span",{class:"mord"},[s("span",{class:"mord mathrm"},"mod")])]),s("span",{class:"mspace",style:{"margin-right":"0.0556em"}}),s("span",{class:"mspace",style:{"margin-right":"0.2222em"}})]),s("span",{class:"base"},[s("span",{class:"strut",style:{height:"0.4306em"}}),s("span",{class:"mord mathnormal"},"n")])])])])],-1)),a[6]||(a[6]=n(`<ul><li>密钥交换DiffieHellman 在不安全信道建立共享密钥。</li><li>数字签名:私钥签名、公钥验证,保障真实性与不可否认性。</li></ul><h3 id="_2-5-关键历史时间线" tabindex="-1"><a class="header-anchor" href="#_2-5-关键历史时间线"><span>2.5 关键历史时间线</span></a></h3><div class="language- line-numbers-mode" data-highlighter="shiki" data-ext="" style="--shiki-light:#393a34;--shiki-dark:#dbd7caee;--shiki-light-bg:#ffffff;--shiki-dark-bg:#121212;"><pre class="shiki shiki-themes vitesse-light vitesse-dark vp-code"><code class="language-"><span class="line"><span>公元前5世纪斯巴达密码棒</span></span>
<span class="line"><span>公元前1世纪凯撒密码</span></span>
<span class="line"><span>16世纪维吉尼亚密码</span></span>
<span class="line"><span>1918年一次一密密码本</span></span>
<span class="line"><span>1949年香农信息论</span></span>
<span class="line"><span>1977年DES和RSA算法</span></span>
<span class="line"><span>2001年AES标准</span></span></code></pre><div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0;"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="总结" tabindex="-1"><a class="header-anchor" href="#总结"><span>总结</span></a></h2><p>密码学作为信息安全的基石,经历了从简单替换到复杂数学算法的漫长发展历程。现代密码学建立在严格的数学基础之上,通过对称加密、非对称加密等多种技术手段,为数字世界提供了可靠的安全保障。</p><p>理解密码学的基本原理和分类,有助于我们更好地应用这些技术来保护信息安全,同时也为深入学习更高级的密码学概念奠定基础。</p><p>本篇笔记的所有代码开源于:<a href="https://gitea.simengweb.com/si-meng-spec/cryptography-example-code" target="_blank" rel="noopener noreferrer">https://gitea.simengweb.com/si-meng-spec/cryptography-example-code</a></p>`,7))])}const g=m(r,[["render",c]]),d=JSON.parse('{"path":"/theory/cryptography/","title":"密码学基础","lang":"zh-CN","frontmatter":{"title":"密码学基础","createTime":"2025/10/27 10:38:57","permalink":"/theory/cryptography/"},"readingTime":{"minutes":5.34,"words":1603},"git":{"createdTime":1761564580000,"updatedTime":1761716737000,"contributors":[{"name":"祀梦","username":"","email":"3501646051@qq.com","commits":2,"avatar":"https://gravatar.com/avatar/6406a81eeddc359cf3d3ce018797689fc6d014ff06215c27d0210b42e8f5a8ab?d=retro"}]},"filePathRelative":"notes/theory/cryptography/README.md","headers":[]}');export{g as comp,d as data};