1. Trang chủ
  2. » Công Nghệ Thông Tin

Nghiên cứu và xây dựng một thuật toán mã hóa thông điệp nhờ kết hợp giữa mật mã chuyển vị và mật mã VIGENERE (Đồ án tốt nghiệp)

70 130 1

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

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nghiên cứu và xây dựng một thuật toán mã hóa thông điệp nhờ kết hợp giữa mật mã chuyển vị và mật mã VIGENERE (Đồ án tốt nghiệp)Nghiên cứu và xây dựng một thuật toán mã hóa thông điệp nhờ kết hợp giữa mật mã chuyển vị và mật mã VIGENERE (Đồ án tốt nghiệp)Nghiên cứu và xây dựng một thuật toán mã hóa thông điệp nhờ kết hợp giữa mật mã chuyển vị và mật mã VIGENERE (Đồ án tốt nghiệp)Nghiên cứu và xây dựng một thuật toán mã hóa thông điệp nhờ kết hợp giữa mật mã chuyển vị và mật mã VIGENERE (Đồ án tốt nghiệp)Nghiên cứu và xây dựng một thuật toán mã hóa thông điệp nhờ kết hợp giữa mật mã chuyển vị và mật mã VIGENERE (Đồ án tốt nghiệp)Nghiên cứu và xây dựng một thuật toán mã hóa thông điệp nhờ kết hợp giữa mật mã chuyển vị và mật mã VIGENERE (Đồ án tốt nghiệp)Nghiên cứu và xây dựng một thuật toán mã hóa thông điệp nhờ kết hợp giữa mật mã chuyển vị và mật mã VIGENERE (Đồ án tốt nghiệp)Nghiên cứu và xây dựng một thuật toán mã hóa thông điệp nhờ kết hợp giữa mật mã chuyển vị và mật mã VIGENERE (Đồ án tốt nghiệp)

, cho em e ! Sinh viên PH N M U M T C 1.1 M N u : 1.2 d ch chuy n 1.3 thay th 1.4 Apphin 1.5 Vigenere 10 : Vigenere(( P , C , K , E , D) 10 1.5.2 d : Cho Khóa k t CIPHER , 10 1.6 Hill 12 1.7 chuy n v 14 14 1.7.2 d : 15 m t 18 18 18 g pháp hóa : 18 i : 19 20 2.2 23 23 23 2.2.3 i 24 26 27 3.1 S k t h p hai chuy n v Vigenere 27 3.1.1 Lý thuy t : 27 3.1.2 hóa 27 3.1.3 Gi i 27 Demo 28 3.3 ngu n 30 62 63 64 PH N M Các h m t c U n d ng c a h m i x ng i x ng ch h l p ta có th t khóa c khóa gi i m t cách d dàng (vì v ng coi chúng m ng th i vi c gi i ta i th c l p Các h thu c lo i có th i gian l p gi i nhanh th h ix l i x ng yêu c u ph i gi bí m t hồn tồn v khóa l p N cs d t khóa l t b i i thi Hi n tin h có m t hóa nh ng d li u vi c c n thi hóa thơng tin: c áp d ng vào h u h ng r t l c cu c s ng i v i s t n t i phát tri n c a ngành khoa h c khác Trong m i h th ng tin h c, thông tin thành ph quan tr ng nh t Chúng ta không không g p ph i nh n nh t ng h p máy tính b m t h t nh ng thông tin quan tr ng nhi u nguyên nhân khác virus, b ng thi t b , khơng bi t s d ng, b an tồn b o m t thông tin r thu c vào nhi u y u t ch ng, công ngh p hay xố ng ph i, mơi n có r t nhi u cơng c ph n m m h tr an toàn cho h th ng máy tính Tuy nhiên v n tồn r t ph c t p ch n l a m t h th ng an i b i m t h th r t an tồn hơm có th khơng an tồn n a vào ngày mai N u ng xuyên theo dõi thông tin b o m t Internet, có th th y thông tin v nh ng l h ng b o m t c a h m t, d ch v y an toàn b o m t thông tin m t nh ng thành ph n quan tr ng nh t c c a h th ng u hành, ph n m m b o c quan tâm vi c trì phát tri n M t v an tồn thơng tin ? M t hi i Ai c p Khi cu c chi n tranh x y gi ch Thông tin c ch (letter), ch s (number) hay lo hoá Bên B nh c n i dung M i d ng cg c c thơng tin hố th c hi n vi c gi hi u il y ó cb hi c n i dung c a thông tin ch có A B m i có cách gi i Th i kì thơng tin cb om tb c i h m t n Các h m t s m nh c bi t Ceazar - dich chuy n (Shift Cipher), th m s d ng m t th i gi n toán h c phát tri n Các h m i c xây d ng lý thuy t v toán h c hi xây d ng d c i M t th h m ph c t p tính tốn, h m hi i Các ng d ng c a h m t nhi v c xã h i Giúp gi i qu t hàng lo t v c c g i h c áp d ng v an tồn thơng tin kênh thông tin không b o m t M t cung c p m t gi i pháp nh m m c hi n bi n m t thông tin c th d hi u thành m t d ng khác (khó hi u) có quan h ch t ch v i thông tin g c Gi b n rõ b n b ov y m t ? T i l i t thơng tin ? c a ? : M t h c s nghiên c n m t s khía c nh c c liên an toàn, s toàn v n d li u, s xác nh n t n t i s xác nh n tính ngun b n c a thơng tin t gi i thi u m t c n: M T C 1.1 M N u: Mong mu i thơng tin m t cách bí m t m t nh ng ic i xu t hi n t r t s m l ch s th l ch s c a vi c i thông tin m t r t phong phú bao g m nh ng phát y tính giai tho i Ngành h c nghiên c u cách th c che d nh iv i ng không mong mu n g i m t h c ( cryptography) M b o v bí m t c a thông tin thông tin c truy n kênh thông tin b o m - i A mu n g n tho i,m ng truy n iBm n b ng ti ng Vi t ( g n c b o m t A ph i l p m n i b n cho B A B có m t khóa m t chung, v B gi i khác khơng có kênh truy hi - Các h m t c Al p bi n c n i dung thông báo A g i cho B n th c hi n vi c b o m u dùng m t kháo chung cho vi c l p gi i mã, b n rõ b b n ch t nhiên, c th ta s dùng 26 ch b n ch ti ng Anh hi dùng quan ni m toán h M t h m t m t b P m t t p h u h n b n rõ C m t t p h u h n b n K m t t p h u h n khóa mơ t hình th u ki n V im ik K , có m t hàm l p ek hàm gi i dk D , dk : C -> P cho dk(ek(x)) = x v i m i x Trong th c t dài c E ,sao cho ek : P -> C, m t P ng b ng ch ( ho c t p dãy ch có nh) N u b n rõ (m t xâu ch cái): x = x1x2x3 n (xi P ), khoá k y = y1y2y3 n (yi C) i K b n s là: = ek(xi c b n y, bi t khoá k, s tìm c b n rõ x, xi = dk(yi) ng ch dùng s 0, , 24, 25 dùng phép toán s h c theo modulo 26 bi di n t phép i b ng ch A B C D E F G H I J K L 10 11 12 13 O P Q R S T U V W X M N Y Z 14 15 16 17 18 19 20 21 22 23 24 25 1.2 d ch chuy n Kí hi u Z m t p s nguyên t vành s nguyên t n (m-1), ký hi u c ng dùng cho n (m-1) v i phép c ng nhân v i modulo m Nh v y, b ng ch ti ng Anh có th xem m t vành Z26 v i s t k ng ng } private void initComponents() { tf_vigenere = new javax.swing.JTextField(); tf_chuyenvi = new javax.swing.JTextField(); bt_giaima = new javax.swing.JButton(); bt_xoa = new javax.swing.JButton(); bt_thoat = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); ta_banma = new javax.swing.JTextArea(); jScrollPane2 = new javax.swing.JScrollPane(); ta_banro = new javax.swing.JTextArea(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Gi i thông tin"); setBounds(new java.awt.Rectangle(500, 200, 0, 0)); setResizable(false); tf_vigenere.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N tf_chuyenvi.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N bt_giaima.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N bt_giaima.setForeground(new java.awt.Color(0, 0, 204)); bt_giaima.setText("Gi i mã"); bt_giaima.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bt_giaimaActionPerformed(evt); } }); bt_xoa.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N bt_xoa.setForeground(new java.awt.Color(0, 0, 204)); bt_xoa.setText("Xóa"); bt_xoa.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bt_xoaActionPerformed(evt); } }); bt_thoat.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N bt_thoat.setForeground(new java.awt.Color(0, 0, 204)); bt_thoat.setText("Thoát"); bt_thoat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { bt_thoatActionPerformed(evt); } }); jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel1.setForeground(new java.awt.Color(0, 0, 255)); jLabel1.setText("Khóa Vigenere"); jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel2.setForeground(new java.awt.Color(0, 0, 255)); jLabel2.setText("B n mã"); ta_banma.setColumns(20); ta_banma.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N ta_banma.setRows(5); jScrollPane1.setViewportView(ta_banma); ta_banro.setColumns(20); ta_banro.setFont(new java.awt.Font("Times New Roman", 0, 14)); // NOI18N ta_banro.setForeground(new java.awt.Color(204, 0, 0)); ta_banro.setRows(5); jScrollPane2.setViewportView(ta_banro); jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel4.setForeground(new java.awt.Color(0, 0, 255)); jLabel4.setText("B n rõ"); jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N jLabel5.setForeground(new java.awt.Color(0, 0, 255)); jLabel5.setText("Khóa chuy n v "); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) addGroup(layout.createSequentialGroup() addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD ING) addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE) addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT ED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 340, javax.swing.GroupLayout.PREFERRED_SIZE)) addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() addContainerGap() addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT ED) addComponent(tf_vigenere, javax.swing.GroupLayout.PREFERRED_SIZE, 340, javax.swing.GroupLayout.PREFERRED_SIZE)) addGroup(layout.createSequentialGroup() addContainerGap() addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT ED) addComponent(tf_chuyenvi, 340, Short.MAX_VALUE)) javax.swing.GroupLayout.DEFAULT_SIZE, addGroup(layout.createSequentialGroup() addGap(18, 18, 18) addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L EADING) addGroup(layout.createSequentialGroup() addComponent(bt_giaima) addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELA TED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) addComponent(bt_xoa, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE) addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELA TED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(bt_thoat, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)) addGroup(layout.createSequentialGroup() addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE) addGap(18, 18, 18) addComponent(jScrollPane2))))) addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) addGroup(layout.createSequentialGroup() addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD ING) addGroup(layout.createSequentialGroup() addContainerGap() addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)) addGroup(layout.createSequentialGroup() addGap(50, 50, 50) addComponent(jLabel2))) addGap(18, 18, 18) addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASE LINE) addComponent(tf_vigenere, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) addComponent(jLabel1)) addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, Short.MAX_VALUE) 15, .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD ING, false) addGroup(layout.createSequentialGroup() addGap(1, 1, 1) addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) addComponent(tf_chuyenvi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) addGap(28, 28, 28) addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD ING) addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) addComponent(bt_giaima) addComponent(bt_thoat)) addComponent(bt_xoa, javax.swing.GroupLayout.Alignment.TRAILING)) addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEAD ING) addGroup(layout.createSequentialGroup() addGap(18, 18, 18) addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)) addGroup(layout.createSequentialGroup() addGap(52, 52, 52) addComponent(jLabel4))) addGap(57, 57, 57)) ); pack(); }// private String chuoi="ABCDEFGHIJKLMNOPQRSTUVWXYZ"; public String getChuoi() { return chuoi; } public void setChuoi(String chuoi) { this.chuoi = chuoi; } // -public int[] mang_chiso(String s){ char[] s_s = s.toCharArray(); int[] x = new int[s.length()]; for (int i = 0; i < s.length(); i++) { x[i] = getChuoi().indexOf(s_s[i]); } return x; } // -public String chiso_chuoi(int[] a){ String s = ""; char[] chuyen_chuoi = getChuoi().toCharArray(); for (int i = 0; i < a.length; i++) { s += chuyen_chuoi[a[i]]; } return s; } // public String giaima_vigenere(String banma,String khoa){ banma = banma.toUpperCase(); khoa = khoa.toUpperCase(); String x=""; int[] y = new int[banma.length()]; int[] k = new int[banma.length()]; int[] kq = new int[banma.length()]; y = mang_chiso(banma); k = mang_chiso(khoa); int i,j; for(i=0,j=0;i

Ngày đăng: 25/02/2018, 08:01

Xem thêm:

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w