C# 哈希加密
来源:互联网 发布:数据库可以存图片吗 编辑:程序博客网 时间:2024/05/21 14:48
using System;using System.Text;using System.Security.Cryptography;namespace DotNet.Utilities{/// <summary>/// 得到随机安全码(哈希加密)。/// </summary>public class HashEncode{public HashEncode(){//// TODO: 在此处添加构造函数逻辑//}/// <summary>/// 得到随机哈希加密字符串/// </summary>/// <returns></returns>public static string GetSecurity(){string Security = HashEncoding(GetRandomValue());return Security;}/// <summary>/// 得到一个随机数值/// </summary>/// <returns></returns>public static string GetRandomValue(){Random Seed = new Random();string RandomVaule = Seed.Next(1, int.MaxValue).ToString();return RandomVaule;}/// <summary>/// 哈希加密一个字符串/// </summary>/// <param name="Security"></param>/// <returns></returns>public static string HashEncoding(string Security){byte[] Value;UnicodeEncoding Code = new UnicodeEncoding();byte[] Message = Code.GetBytes(Security);SHA512Managed Arithmetic = new SHA512Managed();Value = Arithmetic.ComputeHash(Message);Security = "";foreach(byte o in Value){Security += (int) o + "O";}return Security;}}}
0 0
- C# 哈希加密
- C# 哈希加密
- C# 加密
- C#加密
- C#加密
- C#加密
- c# 加密
- c# 加密
- C# 加密
- MVC 密码加密(哈希加密)
- 用C#实现的数据加密(二) —— 哈希算法
- 用C#实现的数据加密(二) —— 哈希算法
- 用C#实现的数据加密(二) —— 哈希算法
- 用C#实现的数据加密(二) —— 哈希算法
- 用C#实现的数据加密(二)——哈希算法
- 用C#实现的数据加密—— 哈希算法
- C#中的加密技术
- c#反编译和加密
- [ArmCompiler6--armlink]armlink使用介绍
- camel 支持htts接入概述
- js 邮箱校验
- OpenWrt的rpcd的使用
- Android Emoji的处理
- C# 哈希加密
- 下载文件时,为什么要使用URLEncoder编码名称
- 通过xml文件配置 spring自动装配5中模式
- 任意进制转换
- 静态顺序表
- cordova 常用命令、插件
- MySQL操作权限增删改查
- android的消息处理机制(图+源码分析)——Looper,Handler,Message
- HSV to RGB and RGB to HSV