標籤:技術 加密 密碼 認證
加密 和解密
1,對稱式加密
2,非對稱式加密
3,單項加密
密碼編譯演算法都遵循:kerckhoffs principle
對稱式加密:加密解密使用同一個密鑰
常用的有 3des ,AES 進階加密 128 位,192,和256
非對稱式加密(公開金鑰加密):可以加密和解密
主要是用來認證的
公開金鑰機密演算法:成對出現
rsa 加密 還可以認證
dsa 只能加密
私密金鑰 ,隱藏在公開金鑰 512位,1024,2048,4096位
密碼越長 速度越慢
公開金鑰 主要是用來認證的
單項加密: 是無法復原的,
雪崩效應 輸入的資料有一點不同,就有很大不同
就是計算一段資料的特徵值
輸出定長 輸入的資料 和的出來的是一樣長度
常用 MD5:Message,Digest 128位
sha1 : 安全的hash 演算法 160位
主要目的 :防爆裡破解
pki :CA 數位憑證頒發
使用openssl頒發認證:
以下步驟
1, cd /etc/pki/CA
2,(umask 66;openssl genrsa 2048 > private/cakey.pem
3, openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 3650
4,vim /etc/pki/tls/openssl.cnf
用戶端獲的認證:
1,yum install httpd
2, # cd ssl
3,[[email protected] ssl]# (umask 66; openssl genrsa 2048 > web.key)
4, ssl]# cd /etc/pki/CA
[[email protected] CA]# mkdir certs crl newcerts
[[email protected] CA]# touch index.txt serial
[[email protected] CA]# ech0 01 > serial
5,ssl]# openssl req -new -key web.key -out web.csr
6,ssl]# openssl ca -in web.csr -out web.crt
7, 驗證 ll