转至繁体中文版     | 网站首页 | 图文教程 | 资源下载 | 站长博客 | 图片素材 | 武汉seo | 武汉网站优化 | 
最新公告:     敏韬网|教学资源学习资料永久免费分享站!  [mintao  2008年9月2日]        
您现在的位置: 学习笔记 >> 图文教程 >> 软件开发 >> VB.NET程序 >> 正文
VB中实现MD5加密         ★★★★

VB中实现MD5加密

作者:闵涛 文章来源:闵涛的学习笔记 点击数:2966 更新时间:2009/4/23 16:40:12

使用方法:

msgbox DigestStrToHexStr("111")

源代码:

-----------剪切线------------------------------------------------------------

Option Explicit

''''/******************************************************************************
'''' *  Copyright (C) 2000 by Robert Hubley.                                      *
'''' *  All rights reserved.                                                      *
'''' *                                                                            *
'''' *  This software is provided ``AS IS'''''''' and any express or implied            *
'''' *  warranties, including, but not limited to, the implied warranties of      *
'''' *  merchantability and fitness for a particular purpose, are disclaimed.     *
'''' *  In no event shall the authors be liable for any direct, indirect,         *
'''' *  incidental, special, exemplary, or consequential damages (including, but  *
'''' *  not limited to, procurement of substitute goods or services; loss of use, *
'''' *  data, or profits; or business interruption) however caused and on any     *
'''' *  theory of liability, whether in contract, strict liability, or tort       *
'''' *  (including negligence or otherwise) arising in any way out of the use of  *
'''' *  this software, even if advised of the possibility of such damage.         *
'''' *                                                                            *
'''' ******************************************************************************
''''
''''  CLASS: MD5
''''
''''  DESCRIPTION:
''''     This is a class which encapsulates a set of MD5 Message Digest functions.
''''     MD5 algorithm produces a 128 bit digital fingerprint (signature) from an
''''     dataset of arbitrary length.  For details see RFC 1321 (summarized below).
''''     This implementation is derived from the RSA Data Security, Inc. MD5 Message-Digest
''''     algorithm reference implementation (originally written in C)
''''
''''  AUTHOR:
''''     Robert M. Hubley 12/1999
''''
''''
''''  NOTES:
''''      Network Working Group                                    R. Rivest
''''      Request for Comments: 1321     MIT Laboratory for Computer Science
''''                                             and RSA Data Security, Inc.
''''                                                              April 1992
''''
''''
''''                           The MD5 Message-Digest Algorithm
''''
''''      Summary
''''
''''         This document describes the MD5 message-digest algorithm. The
''''         algorithm takes as input a message of arbitrary length and produces
''''         as output a 128-bit "fingerprint" or "message digest" of the input.
''''         It is conjectured that it is computationally infeasible to produce
''''         two messages having the same message digest, or to produce any
''''         message having a given prespecified target message digest. The MD5
''''         algorithm is intended for digital signature applications, where a
''''         large file must be "compressed" in a secure manner before being
''''         encrypted with a private (secret) key under a public-key cryptosystem
''''         such as RSA.
''''
''''         The MD5 algorithm is designed to be quite fast on 32-bit machines. In
''''         addition, the MD5 algorithm does not require any large substitution
''''         tables; the algorithm can be coded quite compactly.
''''
''''         The MD5 algorithm is an extension of the MD4 message-digest algorithm
''''         1,2]. MD5 is slightly slower than MD4, but is more "conservative" in
''''         design. MD5 was designed because it was felt that MD4 was perhaps
''''         being adopted for use more quickly than justified by the existing
''''         critical review; because MD4 was designed to be exceptionally fast,
''''         it is "at the edge" in terms of risking successful cryptanalytic
''''         attack. MD5 backs off a bit, giving up a little in speed for a much
''''         greater likelihood of ultimate security. It incorporates some
''''         suggestions made by various reviewers, and contains additional
''''         optimizations. The MD5 algorithm is being placed in the public domain
''''         for review and possible adoption as a standard.
''''
''''         RFC Author:
''''         Ronald L.Rivest
''''         Massachusetts Institute of Technology
''''         Laboratory for Computer Science
''''         NE43 -324545    Technology Square
''''         Cambridge, MA  02139-1986
''''         Phone: (617) 253-5880
''''         EMail:    Rivest@ theory.lcs.mit.edu
''''
''''
''''
''''  CHANGE HISTORY:
''''
''''     0.1.0  RMH    1999/12/29      Original version
''''
''''


''''=
''''= Class Constants
''''=
Private Const OFFSET_4 = 4294967296#
Private Const MAXINT_4 = 2147483647

Private Const S11 = 7
Private Const S12 = 12
Private Const S13 = 17
Private Const S14 = 22
Private Const S21 = 5
Private Const S22 = 9
Private Const S23 = 14
Private Const S24 = 20
Private Const S31 = 4
Private Const S32 = 11
Private Const S33 = 16
Private Const S34 = 23
Private Const S41 = 6
Private Const S42 = 10
Private Const S43 = 15
Private Const S44 = 21


''''=
''''= Class Variables
''''=
Private State(4) As Long
Private ByteCounter As Long
Private ByteBuffer(63) As Byte


''''=
''''= Class Properties
''''=
Property Get RegisterA() As String
    RegisterA = State(1)
End Property

Property Get RegisterB() As String
    RegisterB = State(2)
End Property

Property Get RegisterC() As Strin

[1] [2] [3] [4]  下一页


[Web开发]ASP.Net中的MD5加密  
教程录入:mintao    责任编辑:mintao 
  • 上一篇教程:

  • 下一篇教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      注:本站部分文章源于互联网,版权归原作者所有!如有侵权,请原作者与本站联系,本站将立即删除! 本站文章除特别注明外均可转载,但需注明出处! [MinTao学以致用网]
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    同类栏目
    · C语言系列  · VB.NET程序
    · JAVA开发  · Delphi程序
    · 脚本语言
    更多内容
    热门推荐 更多内容
  • 没有教程
  • 赞助链接
    更多内容
    闵涛博文 更多关于武汉SEO的内容
    500 - 内部服务器错误。

    500 - 内部服务器错误。

    您查找的资源存在问题,因而无法显示。

    | 设为首页 |加入收藏 | 联系站长 | 友情链接 | 版权申明 | 广告服务
    MinTao学以致用网

    Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved.
    闵涛 投放广告、内容合作请Q我! E_mail:admin@mintao.net(欢迎提供学习资源)

    站长:MinTao ICP备案号:鄂ICP备11006601号-18

    闵涛站盟:医药大全-武穴网A打造BCD……
    咸宁网络警察报警平台