对称加密之AES及压缩加密解密解压综合实战

发布时间:2017-02-08 17:54:02   来源:文档文库   
字号:

对称加密之AES及压缩加密解密解压综合实战


对称加密:就是采用这种加密方法的双方使用方式用同样的密钥进行加密和解密。密钥是控制加密及解密过程的指令。算法是一组规则,规定如何进行加密和解密。

因此加密的安全性不仅取决于加密算法本身,密钥管理的安全性更是重要。因为加密和解密都使用同一个密钥,如何把密钥安全地传递到解密者手上就成了必须要解决的问题。

由此可见密钥传递也是比较重要的一环,一般都是通过对密钥二次加密的方式,进行密钥的传输

加密实现代码:

publicstaticKey

Check

null

"plainText"

KeynullKey

"Key"

null

"IV"

null

null

KeyKey

Key

null

return

解密代码实现:

publicstaticKey

null

"cipherText"

KeynullKey

"Key"

null

"IV"

null

null

KeyKey

Key

Read

intRead

null

return

客户端加密解密文本文件实战:

asciiEncnew

initVectorBytesasciiEnc

keyK2Generator

hashProviderMD5

md5EncryptedKeyK2hashProvider

filename"NewTextDocument.txt"

filepathEnvironment

ContentEncryption

encryptfilepathEnvironment

decryptContentEncryption

decryptfilepathEnvironment

压缩解压:

"NewTextDocument.txt"

"\\"

"\\NewTextDocument.zip"

"iso-8859-1"

压缩加密解密解压:

"NewTextDocument.zip"

"\\"

"\\"

"iso-8859-1"

"\\NewTextDocument.txt"

"NewTextDocument.txt"

"@1B2c3D4e5F6g7H8"

orkeykeyKeyto

bitforkey

Create

"\\encrypt"

"\\decrypt"

"\\unzip\\decrypt"

keyConvert

Convert

key

ConvertkeyConvert

"\\decrypt1"

"\\unzip\\decrypt1"

【编辑推荐】

加密妙招:让逆向工程毫无用武之地

如何对LUKS加密的磁盘/分区执行远程增量备份?

找回MD5加密的密码及MD5加密数据库中数据

本文来源:https://www.2haoxitong.net/k/doc/d6a5b00211a6f524ccbff121dd36a32d7375c73b.html

《对称加密之AES及压缩加密解密解压综合实战.doc》
将本文的Word文档下载到电脑,方便收藏和打印
推荐度:
点击下载文档

文档为doc格式