posts-go/docs/2023-08-23-real-world-crypt...

84 lines
2.5 KiB
HTML
Raw Normal View History

2023-08-23 17:09:04 +00:00
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.2.0/github-markdown.min.css"
/>
<title>haunt98 posts</title>
</head>
<style>
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
}
@media (max-width: 767px) {
.markdown-body {
padding: 15px;
}
}
</style>
<body class="markdown-body">
<h2>
<a href="index.html"><code>~</code></a>
</h2>
<h1>
<a
id="user-content-real-world-crypto-101"
class="anchor"
aria-hidden="true"
2023-08-30 03:28:39 +00:00
tabindex="-1"
2023-08-23 17:09:04 +00:00
href="#real-world-crypto-101"
><span aria-hidden="true" class="octicon octicon-link"></span></a
>Real World Crypto 101
</h1>
<p>
My notes when reading
<a
href="https://www.manning.com/books/real-world-cryptography"
rel="nofollow"
>Real-World Cryptography</a
>
</p>
<p><strong>Hash</strong> function convert from input to digest:</p>
<ul>
<li>Pre-image resistance: Given digest, can not find input</li>
<li>
Second pre-image resistance: Given input, digest, can not find another
input produce same digest. Small change to input make digest big change.
</li>
<li>Collision resistance: Can not find 2 input produce same digest.</li>
</ul>
<p>
<strong>MAC</strong> aka Message Authentication Code produce from key,
message to authentication tag. <strong>HMAC</strong> is MAC using hash.
2023-08-23 17:09:04 +00:00
</p>
<ul>
<li>A send B message with MAC (generate from message and A key).</li>
<li>
B double check message with MAC (generate from receive message and B
key).
</li>
<li>A and B use same key.</li>
</ul>
2023-08-23 17:09:04 +00:00
<div>
Feel free to ask me via
<a href="mailto:hauvipapro+posts@gmail.com">email</a> or
<a rel="me" href="https://hachyderm.io/@haunguyen">Mastodon</a>.
<br />Source code is available on
<a href="https://github.com/haunt98/posts-go">GitHub</a>
<a href="https://codeberg.org/yoshie/posts-go">Codeberg</a>
<a href="https://git.sr.ht/~youngyoshie/posts-go">sourcehut</a>
<a href="https://gitea.treehouse.systems/yoshie/posts-go">Treehouse</a>
<a href="https://gitlab.com/youngyoshie/posts-go">GitLab</a>
</div>
</body>
</html>