Hill cipher:
Vigenère cipher:
One reasonable idea for enhancing the security of a cryptosystem is to use double encryption. Is double encryption with the Hill cipher any safer than simple encryption? Justify your answer.
Encrypt the message LJUBLJANA using the Vigenère cipher with the key FRI. Compute the index of coincidence of the obtained ciphertext.
1 2
01234567890123456789012345
ABCDEFGHIJKLMNOPQRSTUVWXYZ
L | J | U | B | L | J | A | N | A |
---|---|---|---|---|---|---|---|---|
11 | 9 | 20 | 1 | 11 | 9 | 0 | 13 | 0 |
F | R | I | F | R | I | F | R | I |
5 | 17 | 8 | 5 | 17 | 8 | 5 | 17 | 8 |
16 | 0 | 2 | 6 | 2 | 17 | 5 | 4 | 8 |
Q | A | C | G | C | R | F | E | I |
Computation of the index of coincidence
The following ciphertext has been encrypted with the Vigenère cipher. Find the possible key lengths with the Kasiski test. Word divisions have not been preserved.
1 2 3 4
01234 56789 01234 56789 01234 56789 01234 56789 012
NKASF BBYIY PWZCW TBIYK PFKUF KBJIA NKABY IYPWZ JMJ
Repetitions:
NKA
: 0, 30, offset: 30BYIYPWZ
: 6, 33, offset: 27Key length candidates: divisors of \(\gcd(30, 27) = 3\)
\(a, b \in \mathbb{Z}_p\), \(n\) digits long (in an \(\alpha\)-based system), \(n \approx \log_\alpha(a)\)
Calculate \(3^6 \bmod{17}\) using the square-and-multiply algorithm.
bit | square | multiply |
---|---|---|
1 | \(3^0 = 1\) | \(3^1 = 3\) |
1 | \(3^2 = 9\) | \(3^3 = 27 = 10\) |
0 | \(3^6 = 100 = 15\) | \(3^6 = 15\) |
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