Thực hành mạng máy tính nâng cao

3 2 0
Thực hành mạng máy tính nâng cao

Đang tải... (xem toàn văn)

Thông tin tài liệu

Lab 2: Classical Encryption Techniques, RSA, DES, Hash and Authentication Protocols Student Name: Hoàng Nguyễn Anh Quốc Student No: 51002641 I Objectives Get knowledge of the use of some common cryptographic techniques: Monoalphabetic substitution cipher, RSA, DES II Preparation You need to install OpenSSL with some requirements: make Perl an ANSI C compiler a development environment in form of development libraries and C header files a supported Unix operating system Following these steps to install OpenSSL: Create “net2/local/openssl” in your home directory: $ mkdir –p net2/local/openssl Extract openssl from compressed file and enter the directory: tar zxvf openssl-1.0.1e.tar.gz; cd openssl-1.0.1e Install: $ configure and install: $ /config prefix=/home/cuong/net2/local –openssldir =/home/cuong/net2/local/openssl $ make $ make test $ make install CuuDuongThanCong.com https://fb.com/tailieudientucntt III Monoalphabetic substitution cipher The earliest known use of a substitution cipher, and the simplest, was by Julius Caesar The Caesar cipher involves replacing each letter of the alphabet with the letter standing three places further down the alphabet For example, plain: meet me after the toga party cipher: PHHW PH DIWHU WKH WRJD SDUWB Note that the alphabet is wrapped around, so that the letter following Z is A We can define the transformation by listing all possibilities, as follows: plain: a b c d e f g h i j k l m n o p q r s t u v w x y z cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C Monoalphabetic substitution cipher is an improvement of Ceasar Cipher The "cipher" line can be any permutation of the 26 alphabetic characters Try to break a cipher text as directed from the site: http://math.ucsd.edu/~crypto/java/EARLYCIPHERS/Monoalphabetic.html You can follow the instruction here: http://math.ucsd.edu/~crypto/java/EARLYCIPHERS/breakmono.html How many possible keys of Ceasar Cipher and monoalphabetic substitution cipher? Monoalphabetic Substitution Cipher: 26! ≈ 288.4 ( khoảng 88 bits) keys Ceasar Cipher: 25 keys How can monoalphabetic substitution cipher be attacked? What are its weaknesses? Dùng phương pháp vét cạn phân tích tần suất (Frequency Analysis) Điểm yếu phương pháp mã hóa dựa vào ngơn ngữ mà người ta đốn tần suất xuất kí tự nhiều dùng công cụ vét cạn trường hợp IV RSA OpenSSL is a full featured encryption toolkit that is used to implement secure services Using openssl create a 2048-bit RSA key pair openssl rsa -pubout -in privatekey.pem -out publickey.pem Create a directory for this part of the lab Store your private key as private.key and your public key as public.key Create a text file input.txt that contains your full name Encrypt the text file with your private key and decrypt it with your public key openssl rsautl -sign -in input.txt -out out_pri.txt -inkey privatekey.pem CuuDuongThanCong.com https://fb.com/tailieudientucntt openssl rsautl -verify -in out_pri.txt -out decrypt_pri.txt -inkey publickey.pem -pubin Encrypt the text file with your public key and decrypt it with your private key openssl rsautl -encrypt -in input.txt -out out_pub.txt -inkey publickey.pem –pubin openssl rsautl -decrypt -in out_pub.txt -out decrypt_pub.txt -inkey privatekey.pem Using OpenSSL extract p, q, n, e,and d from your public-private key pair above V DES Encrypt and decrypt input.txt using tripple des (giả sử password abc) openssl des3 -salt -in input.txt -out out.des3 openssl des3 -d -salt -in out.des3 -out output.txt -k abc From where can you use the symmetric key? Trên thực tế, khóa đại diện cho bí mật phân hưởng hai bên nhiều sử dụng để giữ gìn bí mật kênh truyền thơng tin 10 How can the participants know the symmetric key? Symmetric key gồm có public key private key Người sử dụng cần biết private key bảo mật Khi nhận thơng điệp, cần dùng public key người gửi để giải mã CuuDuongThanCong.com https://fb.com/tailieudientucntt ... des3 -d -salt -in out.des3 -out output.txt -k abc From where can you use the symmetric key? Trên thực tế, khóa đại diện cho bí mật phân hưởng hai bên nhiều sử dụng để giữ gìn bí mật kênh truyền

Ngày đăng: 13/12/2021, 15:14

Tài liệu cùng người dùng

Tài liệu liên quan