or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
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.
Do you want to remove this version name and description?
Syncing
xxxxxxxxxx
Cryptography and computer security - Tutorial 20.10.2020
Algorithms with numbers
Exercise 1
Calculate the following using the square-and-multiply algorithm:
\(13 = 8 + 4 + 1 = 1101_2\)
\(5^{13} \equiv 39 \pmod{61}\)
\(34 = 32 + 2 = 100010_2\)
\(10^{34} \equiv 86 \pmod{97}\)
Exercise 2
Calculate the following using the Euclidean algorithm:
\(\gcd(264, 210) = 6\)
\(\gcd(975, 124) = 1\), \(975 \bot 124\) (coprime)
\(\gcd(89, 55) = 1\)
Exercise 3
Calculate the following using the extended Euclidean algorithm:
\(13^{-1} \bmod{61} = 61 - 14 = 47\)
\(10^{-1} \bmod{97} = 68\)
Exercise 4
Recall that in the Diffie-Hellman protocol, Alice and Bob first agree on a group element \(\alpha\), and then generate secret integers \(a\) and \(b\), respectively, which they use to compute \(\alpha^a\) and \(\alpha^b\). After exchanging these values they can compute the shared secret \(\alpha^{ab}\). Here, we used the multiplicative notation.
Group \((G, \circ)\)
\(\alpha^a = \alpha \circ \alpha \circ \dots \circ \alpha\) (\(a\) times)
Examples: \((\mathbb{Z}_n, +_n)\), \((\mathbb{Z}_p^*, *)\)
The attacker would need to compute \(a = \log_\alpha A\) in \(\mathbb{Z}_p^*\), which is thought to be a hard problem.