This commit is contained in:
Morgan 2024-04-30 18:59:02 +09:00
parent 98f3630082
commit f9c0c66817
No known key found for this signature in database
6 changed files with 91 additions and 152 deletions

View File

@ -12,7 +12,7 @@ params:
description: "Hi! I'm Morgan!" description: "Hi! I'm Morgan!"
keywords: [Blog] keywords: [Blog]
author: Me author: Me
DateFormat: "Jan 2, 2006" DateFormat: "2006-01-02"
assets: assets:
favicon: "https://blog.morgan.kr/favicon.ico" favicon: "https://blog.morgan.kr/favicon.ico"
apple_touch_icon: "https://blog.morgan.kr/favicon.ico" apple_touch_icon: "https://blog.morgan.kr/favicon.ico"

View File

@ -30,7 +30,7 @@ RSA는 일반적으로 알려져 있듯이 매우 큰 소수는 소인수 분해
원리를 바로 설명하자면, 서로 각자 매우 큰 소수 p, q를 준비한다. (p-1), (q-1)과 서로소인 e에 대해, ed mod (p-1)(q-1)이 1인 d의 값을 찾고, N=pq와 e를 공개한다. 이들이 공개키가 되고, d는 개인키가 된다. 원리를 바로 설명하자면, 서로 각자 매우 큰 소수 p, q를 준비한다. (p-1), (q-1)과 서로소인 e에 대해, ed mod (p-1)(q-1)이 1인 d의 값을 찾고, N=pq와 e를 공개한다. 이들이 공개키가 되고, d는 개인키가 된다.
공개키 N, e로 평서문 m을 암호화하기 위해서는 m^e mod N을 계산하면 된다. 개인키 d를 가지고 있는 사람이 이를 복호화 하기 위해서는 $ (m^e)^d mod N $을 계산하면, m을 알아낼 수 있다. 이 고정에서 페르마의 소정리가 이용되는데, 페르마의 소정리란, 어떤 수 N이 있을 때, 이 수와 서로소인 수 a에 대하여, $ a^(\phi(N)) = 1 mod N $가 성립한다는 법칙이다. 이때 $ \phi(n) $은 오일러 파이 함수로, 1-N까지궁 N와 서로소인 수의 개수를 의미한다. N이 두 소인수로 이루어진 합성수라면, $ \phi(N) = (p-1)(q-1) $로 나타난다. 바로 이 값을 이용해서 복호화를 진행한다. $ E*d $는 $ (p-1)(q-1)A + 1 $ 로 나타낼 수 있고, 따라서 $ m^(ed) = m^(A(p-1)(q-1) +1) $인데, $ m^(p-1)(q-1) $은 1이므로, 이 값이 $m$이 된다. 공개키 N, e로 평서문 m을 암호화하기 위해서는 m^e mod N을 계산하면 된다. 개인키 d를 가지고 있는 사람이 이를 복호화 하기 위해서는 $ (m^e)^d mod N $을 계산하면, m을 알아낼 수 있다. 이 고정에서 페르마의 소정리가 이용되는데, 페르마의 소정리란, 어떤 수 N이 있을 때, 이 수와 서로소인 수 a에 대하여, $ a^{\phi(N)} = 1 \mod N $가 성립한다는 법칙이다. 이때 $ \phi(n) $은 오일러 파이 함수로, 1-N까지궁 N와 서로소인 수의 개수를 의미한다. N이 두 소인수로 이루어진 합성수라면, $ \phi(N) = (p-1)(q-1) $로 나타난다. 바로 이 값을 이용해서 복호화를 진행한다. $ E*d $ 는 $ (p-1)(q-1)A + 1 $ 로 나타낼 수 있고, 따라서 $ m^(ed) = m^(A(p-1)(q-1) +1) $인데, $ m^(p-1)(q-1) $은 1이므로, 이 값이 $m$이 된다.
$M^e mod N$과 $N, $e로는 원문 $m$과 개인키 $d$를 계산할 수 없다. 이를 계산하기 위해서는 $M^e mod N$과 $N, $e로는 원문 $m$과 개인키 $d$를 계산할 수 없다. 이를 계산하기 위해서는

View File

@ -6,7 +6,6 @@
<link rel="shortcut icon" href="/favicon.ico" /> <link rel="shortcut icon" href="/favicon.ico" />
<title>{{- block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{- end }}</title> <title>{{- block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{- end }}</title>
<!-- Primary Meta Tags -->
<meta name="title" content="{{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}" /> <meta name="title" content="{{ with .Title }}{{ . }}{{ else }}{{ .Site.Title }}{{ end }}" />
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" /> <meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}" />
<meta name="keywords" content="{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" /> <meta name="keywords" content="{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}" />
@ -16,42 +15,31 @@
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.css" integrity="sha384-wcIxkf4k558AjM3Yz3BBFQUbk/zgIYC2R0QpeeYb+TwlBVMrlgLqwRjRtGZiK7ww" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js" integrity="sha384-hIoBPJpTUs74ddyc4bFZSM1TVlQDA60VBbJS0oA934VSz82sBx1X7kSx2ATBDIyd" crossorigin="anonymous"></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/katex.min.js" integrity="sha384-hIoBPJpTUs74ddyc4bFZSM1TVlQDA60VBbJS0oA934VSz82sBx1X7kSx2ATBDIyd" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous"></script> <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.10/dist/contrib/auto-render.min.js" integrity="sha384-43gviWU0YVjaDtb/GhzOouOXtZMP/7XUzwPTstBeZFe/+rCMvRwr4yROQP43s0Xk" crossorigin="anonymous"></script>
<script>
<script> document.addEventListener("DOMContentLoaded", function() {
document.addEventListener("DOMContentLoaded", function() { renderMathInElement(document.body, {
renderMathInElement(document.body, { delimiters: [
delimiters: [ {left: '$$', right: '$$', display: true},
{left: '$$', right: '$$', display: true}, {left: '$', right: '$', display: false},
{left: '$', right: '$', display: false}, {left: '\\(', right: '\\)', display: false},
{left: '\\(', right: '\\)', display: false}, {left: '\\[', right: '\\]', display: true}
{left: '\\[', right: '\\]', display: true} ],
], throwOnError : false,
throwOnError : false });
}); });
}); </script>
</script>
</head> </head>
<body> <body>
<header> {{ if .IsHome }}
{{ if .IsHome }} <header>
<a href="{{ "" | relURL }}" class="title"> <a href="{{ "" | relURL }}" class="title">
<h2>{{ .Site.Title }}</h2> <h2>{{ .Site.Title }}</h2>
</a> </a>
{{ end }} </header>
<!-- <nav> {{ end }}
<a href="{{ "" | relURL }}">Home</a>
{{ range .Site.Menus.main }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
{{ with .Site.GetPage "/blog" }}
<a href="{{ "blog" | relURL }}">Blog</a>
{{ end }}
</nav> -->
</header>
<main> <main>
{{- block "main" . }}{{- end }} {{- block "main" . }}{{- end }}
</main> </main>
<footer>
</footer>
</body> </body>
</html> </html>

View File

@ -10,10 +10,8 @@
<ul class="blog-posts"> <ul class="blog-posts">
{{ range $pages }} {{ range $pages }}
<li> <li>
<span> <span class="date">
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate> {{ .Date.Format "2006-01-02" }} |
{{ .Date.Format (default "2006-01-02" .Site.Params.dateFormat) }}
</time>
</span> </span>
<a href="{{ .Permalink }}">{{ .Title }}</a> <a href="{{ .Permalink }}">{{ .Title }}</a>
</li> </li>

View File

@ -1,11 +1,11 @@
{{ define "main" }} {{ define "main" }}
<h1>{{ .Title }}</h1> <div class="post-header">
<p> <div class="post-title">{{ .Title }}</div>
<time datetime='{{ .Date.Format "2006-01-02" }}' pubdate> <div class="post-date">{{ .Date.Format "2006-01-02" }}</div>
{{ .Date.Format (default "02 Jan, 2006" .Site.Params.dateFormat) }} <div class="post-divider"></div>
</time> </div>
</p>
<content> <content>
{{ .Content }} {{ .Content }}
</content> </content>

View File

@ -1,80 +1,83 @@
<link rel="stylesheet" href="/css/syntax.css"> <link rel="stylesheet" href="/css/syntax.css">
<style> <style>
body { body {
font-family: "Noto Sans", "Pretendard", sans-serif; font-family: "Source Sans 3", "Pretendard", sans-serif;
font-size: 18px; font-size: 16px;
margin: auto; margin: auto;
padding: 20px; padding: 20px;
max-width: 720px; max-width: 720px;
text-align: left; text-align: left;
background-color: #fff; background-color: white;
word-wrap: break-word; word-wrap: break-word;
overflow-wrap: break-word; overflow-wrap: break-word;
line-height: 1.5; line-height: 1.6;
/* color: #444;*/
} }
h1, h1, h2, h3, h4, h5, h6, b, strong {
h2, font-weight: 400;
h3,
h4,
h5,
h6,
strong,
b {
color: #222;
} }
h1 { h1 { font-size: 26px; }
font-size: 26px ; h2 { font-size: 24px; }
font-weight: bold; h3 { font-size: 22px; }
} h4 { font-size: 20px; }
h2 { h5 { font-size: 18px; }
font-size: 24px ;
font-weight: bold;
}
h3 {
font-size: 22px ;
font-weight: bold;
}
h4 {
font-size: 20px ;
font-weight: bold;
}
h5 {
font-size: 18px ;
font-weight: bold;
}
a { a {
color: #3273dc; color: #3273dc;
} }
.katex {
font-size: 16px !important;
padding: 0 2px;
}
.date {
font-family: monospace;
font-size: 14px;
}
.title { .title {
color: black;
text-decoration: none; text-decoration: none;
border: 0;
} }
.title span { ul.blog-posts {
font-weight: 400; font-size: 16px;
color: #0;
list-style-type: none;
padding: unset;
} }
nav a { ul.blog-posts li a:visited {
margin-right: 10px; color: #8b6fcb;
} }
textarea { .post-header {
text-align: center;
margin: 0 auto;
padding-bottom: 20px;
}
.post-header .post-title {
font-size: 26px;
padding: 18px 0 14px 0;
}
.post-header .post-date {
font-family: monospace;
padding-bottom: 30px;
}
.post-header .post-author {
font-family: monospace;
padding-bottom: 30px;
}
.post-header .post-divider {
background-color: black;
height: 1px;
width: 100%; width: 100%;
font-size: 16px;
}
input {
font-size: 16px;
}
content {
line-height: 1.6;
} }
table { table {
@ -86,9 +89,9 @@ h5 {
} }
code { code {
padding: 2px 5px; padding: 2px 5px;
background-color: #EEE; background-color: #EEE;
font-size: 14px; font-size: 14px;
} }
pre code { pre code {
@ -117,56 +120,10 @@ h5 {
font-style: italic; font-style: italic;
} }
footer {
padding: 25px;
text-align: center;
}
.helptext {
color: #777;
font-size: small;
}
.errorlist {
color: #eba613;
font-size: small;
}
/* blog posts */
ul.blog-posts {
font-size: 18px;
color: #0;
list-style-type: none;
padding: unset;
}
ul.blog-posts li {
display: flex;
}
ul.blog-posts li span {
flex: 0 0 130px;
}
ul.blog-posts li a:visited {
color: #8b6fcb;
}
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
body { body {
background-color: #333; background-color: #333;
color: #ddd; color: white;
}
h1,
h2,
h3,
h4,
h5,
h6,
strong,
b {
color: #eee;
} }
a { a {
@ -174,7 +131,7 @@ h5 {
} }
code { code {
background-color: #777; background-color: #888;
} }
pre code { pre code {
@ -190,10 +147,6 @@ h5 {
background-color: #252525; background-color: #252525;
color: #ddd; color: #ddd;
} }
.helptext {
color: #aaa;
}
} }
</style> </style>