zoukankan      html  css  js  c++  java
  • MD5加密

     1' ----------------------------------------------------
     2        'The Encrypt method enables Encryt a clean string into hash
     3        '
     4        '加密字符串为hash
     5        '
     6        'SHA512Managed().ComputeHash(dataToHash)
     7        'CType(CryptoConfig.CreateFromName("MD5"), HashAlgorithm).ComputeHash(data1ToHash)
     8        '----------------------------------------------------
     9        Public Shared Function Encrypt(ByVal cleanString As StringAs String
    10            '采用MD5
    11            Dim clearBytes As [Byte]()
    12            clearBytes = New UnicodeEncoding().GetBytes(cleanString)
    13            Dim hashedBytes As [Byte]() = CType(CryptoConfig.CreateFromName("MD5"), HashAlgorithm).ComputeHash(clearBytes)
    14            Dim hashedText As String = BitConverter.ToString(hashedBytes)
    15
    16            '再采用MD5
    17            clearBytes = New UnicodeEncoding().GetBytes(hashedText)
    18            hashedBytes = CType(CryptoConfig.CreateFromName("MD5"), HashAlgorithm).ComputeHash(clearBytes)
    19            hashedText = BitConverter.ToString(hashedBytes)
    20
    21            Return hashedText
    22        End Function
  • 相关阅读:
    linux时间同步,ntpd、ntpdate
    重启HPE管理芯片ILO5的5种方法(Reset ilo)
    Linux内核SPI支持概述
    linux 查看CPU详情命令
    高可用
    NFS的介绍
    SELINUX
    error: undefined reference to 'android::hardware::details::return_status::~return_status()'
    errors collectiions
    大型分布式架构设计与实现-第三章互联网安全架构
  • 原文地址:https://www.cnblogs.com/tiasys/p/441833.html
Copyright © 2011-2022 走看看