zoukankan      html  css  js  c++  java
  • 最常用的加密类

     1Imports System.Security.Cryptography
     2Imports System.Text
     3Imports System.Text.RegularExpressions
     4 Public Class Security
     5
     6        '*********************************************************************
     7        '
     8        ' Security.Encrypt() Method
     9        '
    10        ' The Encrypt method encryts a clean string into a hashed string
    11
    12        '
    13        '*********************************************************************
    14        Public Shared Function Encrypt(ByVal cleanString As StringAs String
    15            Dim clearBytes As [Byte]()
    16            clearBytes = New UnicodeEncoding().GetBytes(cleanString)
    17            Dim hashedBytes As [Byte]() = CType(CryptoConfig.CreateFromName("MD5"), HashAlgorithm).ComputeHash(clearBytes)
    18            Dim hashedText As String = BitConverter.ToString(hashedBytes)
    19            Return hashedText
    20        End Function

    21
    22    End Class

    23
    你只要在页面中TxtPassWord.text做为这个函数的参数就可以,很方便的加密方法,加密之后看看数据库哦,全部变成了16进制的数字
  • 相关阅读:
    岩石圈
    地球及其圈层结构
    如何请教一个技术问题
    中国游戏路在何方?
    5.4删除二叉搜索树的任意元素
    5.3 删除二叉搜索树的最大元素和最小元素
    uni-app开发小程序准备阶段
    5.2二叉搜索树遍历(前序、中序、后序、层次、广度优先遍历)
    5.1二叉搜索树基础
    【loj
  • 原文地址:https://www.cnblogs.com/xucanzhao/p/228167.html
Copyright © 2011-2022 走看看