文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>厚积薄发-Web安全

厚积薄发-Web安全

时间:2010-08-30  来源:erxiao

 

1.敏感信息在数据库中要以密文储存

//一个md5加密的函数
     public String md5(String s)
      {
            System.Security.Cryptography.MD5 md5 = new             

            System.Security.Cryptography.MD5CryptoServiceProvider();           
            byte[] bytes = System.Text.Encoding.UTF8.GetBytes(s);
             bytes = md5.ComputeHash(bytes);
             md5.Clear();
 
             string ret = "";
            for(int i=0 ; i<bytes.Length ; i++)
            {               
                ret += Convert.ToString(bytes[i],16).PadLeft(2,'0');
           }
 
           return ret.PadLeft(32,'0');
        }

 

2.防止SQl注入攻击

//替换单引号

tbxLogonName.Text.Replace("'", "").Trim()

 

3.

...

相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载