home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / encrypt / form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-03-19  |  2.1 KB  |  70 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   3195
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   4680
  8.    LinkTopic       =   "Form1"
  9.    ScaleHeight     =   3195
  10.    ScaleWidth      =   4680
  11.    StartUpPosition =   3  'Windows Default
  12.    Begin VB.CommandButton Binary 
  13.       Caption         =   "Binary"
  14.       Height          =   375
  15.       Left            =   1800
  16.       TabIndex        =   3
  17.       Top             =   720
  18.       Width           =   975
  19.    End
  20.    Begin VB.CommandButton Ascii 
  21.       Caption         =   "ASCII"
  22.       Height          =   375
  23.       Left            =   360
  24.       TabIndex        =   2
  25.       Top             =   720
  26.       Width           =   1095
  27.    End
  28.    Begin VB.TextBox password 
  29.       Height          =   285
  30.       IMEMode         =   3  'DISABLE
  31.       Left            =   1440
  32.       TabIndex        =   1
  33.       Top             =   120
  34.       Width           =   1815
  35.    End
  36.    Begin VB.Label Label1 
  37.       Caption         =   "Password:"
  38.       Height          =   255
  39.       Left            =   240
  40.       TabIndex        =   0
  41.       Top             =   120
  42.       Width           =   975
  43.    End
  44. Attribute VB_Name = "Form1"
  45. Attribute VB_GlobalNameSpace = False
  46. Attribute VB_Creatable = False
  47. Attribute VB_PredeclaredId = True
  48. Attribute VB_Exposed = False
  49. Private Sub Ascii_Click()
  50.     Dim md5 As YuriEncrypt.md5
  51.     Set md5 = New YuriEncrypt.md5
  52.     Dim EncryptedPassword As String
  53.     EncryptedPassword = md5.Encrypt(Me.password)
  54.     MsgBox ("The encrypted form of the password you entered is " & vbNewLine & EncryptedPassword)
  55. End Sub
  56. Private Sub Binary_Click()
  57.     Dim md5 As YuriEncrypt.md5
  58.     Set md5 = New YuriEncrypt.md5
  59.     Dim Pwd As String
  60.     Pwd = Me.password.Text
  61.     Dim BinPwd() As Byte
  62.     ReDim BinPwd(1 To Len(Pwd))
  63.     For i = 1 To Len(Pwd)
  64.         BinPwd(i) = Asc(Mid(Pwd, i, 1))
  65.     Next i
  66.     Dim EncryptedPassword As String
  67.     EncryptedPassword = md5.EncryptBinary(BinPwd)
  68.     MsgBox ("The encrypted form of the password you entered is " & vbNewLine & EncryptedPassword)
  69. End Sub
  70.