- •1. У власному каталозі створимо підкаталог tzi2 і перейдемо до нього
- •2.Згенеруйте свої ключі під іменем dmitry
- •3. Переглянути характеристи ключів.
- •4.Зашифруємо звичайний текст
- •5.Розшифруємо цей текст
- •6.Створити підпис текстового файлу
- •7.Перевіримо справжність цифрового підпису .
- •8.Створити архів (tar -cvf .. ) і створити для нього цифровий підпис.
- •9.Перевірити справжність цифрофого підпису архіву
- •10.Експортувати у створений каталог tzi2 свій відкритий ключ.
- •11.Згенерувати ключі під іменем dmitry2
- •12.З власного каталога імпортуйте власний відкритий ключ
11.Згенерувати ключі під іменем dmitry2
dima@Anastary:~/Desktop/Semestr5/TIK/tzi2$ sudo gpg --gen-key
gpg (GnuPG) 1.4.16; Copyright (C) 2013 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please select what kind of key you want:
(1) RSA and RSA (default)
(2) DSA and Elgamal
(3) DSA (sign only)
(4) RSA (sign only)
Your selection? 2
DSA keys may be between 1024 and 3072 bits long.
What keysize do you want? (2048) 1024
Requested keysize is 1024 bits
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) 0
Key does not expire at all
Is this correct? (y/N) y
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"
Real name: dmitry2
Email address: enshteynn@ukr.net
Comment: test2
You selected this USER-ID:
"dmitry2 (test2) <enshteynn@ukr.net>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.
test2
test2
gpg: gpg-agent is not available in this session
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
+++++.+++++++++++++++++++++++++.++++++++++++++++++++++++++++++++++++++++.+++++..+++++.+++++++++++++++.++++++++++....++++++++++++++++++++.++++++++++..........................+++++
Not enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need 158 more bytes)
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
++++++++++.++++++++++.++++++++++++++++++++.+++++++++++++++++++++++++++++++++++..++++++++++.++++++++++++++++++++.+++++++++++++++++++++++++>+++++.................................................................................................................................................................+++++^^^
gpg: key 0E0B4448 marked as ultimately trusted
public and secret key created and signed.
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 2u
pub 1024D/0E0B4448 2014-11-19
Key fingerprint = 1997 EE7F 88DD D092 09D2 53B1 67F9 6A59 0E0B 4448
uid dmitry2 (test2) <enshteynn@ukr.net>
sub 1024g/71812009 2014-11-19
12.З власного каталога імпортуйте власний відкритий ключ
Отримання ,тобто імпортування виконують за командою gpg - -import
dima@Anastary:~/Desktop/Semestr5/TIK/tzi2$ sudo gpg --import mehed.asc
gpg: key AD6E08EC: "dmitry (test) <enshteynn@ukr.net>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
13.Переконайтесь ,що ключ додався до власного набору відкритих ключів.
Переглянемо відкриті ключі інших користувача enshteynn@ukr.net
dima@Anastary:~/Desktop/Semestr5/TIK/tzi2$ sudo gpg --list-keys enshteynn@ukr.net
pub 2048D/AD6E08EC 2014-11-19
uid dmitry (test) <enshteynn@ukr.net>
sub 2048g/729606BF 2014-11-19
pub 1024D/0E0B4448 2014-11-19
uid dmitry2 (test2) <enshteynn@ukr.net>
sub 1024g/71812009 2014-11-19
14.Зашифруйте file для користувача dmitry і збережіть його у власному каталозі
dima@Anastary:~/Desktop/Semestr5/TIK/tzi2$ sudo gpg -r dmitry -ea test.txt
Зашифрували ,додався файл test.txt.asc
15.Зашифруйте і подпишіть file2 для користувача dmitry
Шифр
dima@Anastary:~/Desktop/Semestr5/TIK/tzi2$ sudo gpg -r dmitry -ea test2.txt
Підпис
dima@Anastary:~/Desktop/Semestr5/TIK/tzi2$ sudo gpg --clearsign test2.txt.asc
You need a passphrase to unlock the secret key for
user: "dmitry (test) <enshteynn@ukr.net>"
2048-bit DSA key, ID AD6E08EC, created 2014-11-19
16.Спробуйте розширфувати test.txt.asc and test2.txt.asc за допомогою ключа dmitry2
Для розшифрування файлів dmitry2 набирає команду :
gpg -d file.txt.asc та gpg -d file2.txt.asc
йому пропонують ввести пароль ,який він не знає.Розшифрувати файли може тільки користувач dmitry
17.Розшифруйте файли file.txt.asc та file2.txt.asc
Для розшифрування цього файлу dmitry набирає команду :
dima@Anastary:~/Desktop/Semestr5/TIK/tzi2$ sudo gpg -d test.txt.asc
You need a passphrase to unlock the secret key for
user: "dmitry (test) <enshteynn@ukr.net>"
2048-bit ELG-E key, ID 729606BF, created 2014-11-19 (main key ID AD6E08EC)
gpg: gpg-agent is not available in this session
gpg: encrypted with 2048-bit ELG-E key, ID 729606BF, created 2014-11-19
"dmitry (test) <enshteynn@ukr.net>"
yf,l[
';hgouyidjmzgl'irzhg;o'b
r ]\h;fh
'f'd
h'
fd
dima@Anastary:~/Desktop/Semestr5/TIK/tzi2$ sudo gpg -d test2.txt.asc
You need a passphrase to unlock the secret key for
user: "dmitry (test) <enshteynn@ukr.net>"
2048-bit ELG-E key, ID 729606BF, created 2014-11-19 (main key ID AD6E08EC)
gpg: gpg-agent is not available in this session
gpg: encrypted with 2048-bit ELG-E key, ID 729606BF, created 2014-11-19
"dmitry (test) <enshteynn@ukr.net>"
2пфывфваыаyf,l[п
'а;hпфвыgouyпфаidjmzgl'irzhg;o'b
r вфаыфапфв]\h;fh
'fфывп'вфыd
hп'
fd