文本的des加密
为了对称加密的安全,我将密码进行封装,先新建一个用于保存密码的类库cl: 【程序编程相关:深入Struts 1.1】 【推荐阅读:获得本机IP:】using system; 【扩展信息:Linux网络编程--7. TCP/IP】 using system.text ; namespace cl { /// <summary> /// class1 的摘要说明. /// </summary> public class class1 { public class1() {}
public string getiv() { string iv="********";//八位 return iv; } public string getkey() { string key="01160129";//八位 return key; }}
} 然后新建asp.net项目(c#) 在 .aspx中 using cl; namespace test//给一个文本产生一个散列值 { /// <summary> /// computehash 的摘要说明. /// </summary> public class computehash : system.web.ui.page { protected system.web.ui.webcontrols.label label1; protected system.web.ui.webcontrols.textbox textbox1; protected system.web.ui.webcontrols.button button1; protected system.web.ui.webcontrols.textbox textbox3; protected system.web.ui.webcontrols.button button2; ... 下一页