public static string SHA1Encrypt(string sourceText)
{
SHA1 sha = new SHA1CryptoServiceProvider();
ASCIIEncoding enc = new ASCIIEncoding();
byte[] dataToHash = enc.GetBytes(sourceText);
byte[] dataHashed = sha.ComputeHash(dataToHash);
string hash = BitConverter.ToString(dataHashed).Replace("-", "");
return hash;
}
相关文章
- 在手机和电脑间双向加密传输文件 —— Windows 安装 Kde Connect
- python 应用 base64、hmac、hashlib包实现:MD5编码 base64编码解码、SHA256编码、urlsafe_b64encode编码等等基本所有的加密签名的方法
- SpringBoot 配置文件加密的两种方式
- 在Spring Boot微服务使用jasypt-spring-boot加密和解密yml配置文件
- 国密起步2:GmSSL3使用SM4(对称加密)
- XXTea 加密/解密 字符串
- sip鉴权认证算法详解及python加密
- XXTEA 加密算法的 JavaScript 和 PHP 实现
- 使用DigestUtils实现md5加密算法
- md5加密 密钥加密解密