zoukankan      html  css  js  c++  java
  • 简单适用的密码加密

    许多密码都需要加密,加密不能够太简单,否则容易被破解,但是也不能够太负责,要不然为了加密结果却影响了性能,也不值得,下面这段代码是天天经常使用的一段加密代码。
    注意:一般用户忘记密码时,应该通过条件重设新密码,而不是获取原密码,因为一般密码是不可逆的,也就是根据密文,得不到明文
        public static string Encrypt(string cleanString)
        {
            Byte[] clearBytes = new UnicodeEncoding().GetBytes(cleanString);
            Byte[] hashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);

            return BitConverter.ToString(hashedBytes);
        }

     


    这段代码将根据明文返回加密的密文。
  • 相关阅读:
    MySQL记录
    yolo
    python 深度学习 库文件安装出错汇总
    OPENCV安装
    vs code安装leetcode插件
    打印机
    标注工具
    训练源代码训练数据集
    c++ 学习
    复现基于Pytorch的YOLOv3所踩的坑~
  • 原文地址:https://www.cnblogs.com/mqingqing123/p/949093.html
Copyright © 2011-2022 走看看