C 加密解密大全

2021-09-07 08:07:04 字數 1576 閱讀 5221

1、方法一 (不可逆加密)

public string encryptpassword(string passwordstring,string passwordformat ) 

elseif (passwordformat="md5") 

return encryptpassword ;

}

2、方法二 (可逆加密)

public inte***ce ibindesh

public class encryptiondecryption : ibindesh

return htext;

}public string decode(string str)

return dtext;

}

3、方法三 (可逆加密)

4、md5不可逆加密    (32位加密)

public string ge***5(string s, string _input_charset)

5、加解文字檔案

//加密檔案

private static void encryptdata(string inname, string outname, byte deskey, byte desiv)

encstream.close();

fout.close();

fin.close();

}//解密檔案

private static void decryptdata(string inname, string outname, byte deskey, byte desiv)

encstream.close();

fout.close();

fin.close();

}

6.using system;

using system.collections.generic;

using system.text;

using system.security.cryptography;

using system.io;

namespace component

//預設金鑰向量

private static byte keys =

/**//**//** 

/// des加密字串

/// 

/// 待加密的字串

/// 加密金鑰,要求為8位

/// 加密成功返回加密後的字串,失敗返回源串

public static string encryptdes(string encryptstring, string encryptkey)

catch

}/**//**//** 

/// des解密字串

/// 

/// 待解密的字串

/// 解密金鑰,要求為8位,和加密金鑰相同

/// 解密成功返回解密後的字串,失敗返源串

public static string decryptdes(string decryptstring, string decryptkey)

catch} }

}

C 加密解密大全

1 方法一 不可逆加密 public string encryptpassword string passwordstring,string passwordformat elseif passwordformat md5 return encryptpassword 2 方法二 可逆加密 publ...

C 加密解密

using system using system.text using system.globalization using system.security.cryptography class des 加密字串 public string encryptstring string sinputs...

加密解密 c

include stdafx.h 常量 define c1 52845 define c2 22719 cstring encrypt cstring csdecode,word key 加密函式 csdecode result 儲存結果 result.empty 清除結果 for i 0 i re...