<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>软若石（I Will Get What I Want.） - 加密与解密</title><link>http://blog.csdn.net/ruanruoshi/category/200610.aspx</link><description>加密与解密</description><dc:language>zh-CN</dc:language><lastUpdateTime>Thu, 24 Apr 2008 21:12:08 GMT</lastUpdateTime><ttl>60</ttl><item><dc:creator>软若石</dc:creator><title>凯撒密码加解密的方法。</title><link>http://blog.csdn.net/ruanruoshi/archive/2006/05/08/712898.aspx</link><pubDate>Mon, 08 May 2006 14:29:00 GMT</pubDate><guid>http://blog.csdn.net/ruanruoshi/archive/2006/05/08/712898.aspx</guid><wfw:comment>http://blog.csdn.net/ruanruoshi/comments/712898.aspx</wfw:comment><comments>http://blog.csdn.net/ruanruoshi/archive/2006/05/08/712898.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/ruanruoshi/comments/commentRss/712898.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=712898</trackback:ping><description>凯撒密码加解密的方法。
程序既可用于加密又可用于解密。只要执行：
           java Caesar  明文（要加密的字符串）  密钥（移动的位数）
即可加密。
在密钥前面加上负号，将运行
           java Caesar  明文（要加密的字符串）  -密钥（移动的位数）
即可解密。
    如为了加密字符串“Hello World!”，可随意取一个密钥如4，运行：
java  Caesar "Hello World!" 4
将输出“Lipps Asvph!”。这里“Hello World!”是明文，“Lipps Asvph!”是密文。
    如果密钥大于26，程序中移位前会和26取模而将其调整到26以下。因此运行：
java  Caesar "Hello World!" 30
同样将输出“Lipps Asvph!”。
    为了将密文“Lipps Asvph!”解密，需要知道加密该密文所用的密钥4，这样，执行：
java  Caesar "Lipps Asvph!" -4
将得到明文“Hello World!”。
    如果&lt;img src ="http://blog.csdn.net/ruanruoshi/aggbug/712898.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>