» 网友学堂 » NET教程 » 给大家一个新的加密方法,C#的。(国外的,只用于学习,支持中文) -> 当日更新
给大家一个新的加密方法,C#的。(国外的,只用于学习,支持中文)
作者:问天 发表时间:2007-2-20 11:29 阅读:376次 在百度搜索相关内容

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 )
{
[color=#FFFFFF'][/color]

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;
[color=#FFFFFF'][/color]

}
}<

#Advertisement