自由色彩,无限魅力:www.zyml.net

给大家一个新的加密方法,C#的

上一篇 / 下一篇  2008-02-04 15:35:38

查看( 9 ) / 评论( 0 )
  
using System;
/* The reason that i am using interface is that, in several
* weeks i will use a bitwise operator for have encryption and decryption
* */
public interface IBindesh
{
string encode(string str);
string decode(string str);
}
namespace EncryptionDecryption
{
/// <summary>
/// Summary description for EncryptionDecryption.
/// </summary>
public class EncryptionDecryption : IBindesh
{
public string encode(string str)
{
string htext = ""; // blank text
for ( int i = 0; i < str.Length; i++)

{
htext = htext + (char) (str + 10 - 1 * 2);
}
return htext;
}
public string decode(string str)
{
string dtext = "";
for ( int i=0; i < str.Length; i++)
{
dtext = dtext + (char) (str - 10 + 1*2);
}
return dtext;
}
}
}

TAG:

我来说两句

(可选)

日历

« 2008-12-22  
 123456
78910111213
14151617181920
21222324252627
28293031   

数据统计

  • 访问量: 102927
  • 日志数: 662
  • 图片数: 22
  • 影音数: 169
  • 商品数: 44
  • 文件数: 344
  • 书签数: 20
  • 建立时间: 2007-04-27
  • 更新时间: 2008-10-09

RSS订阅