Source code anti keylogger menggunakan virtual password

Share on :
Source code buatan Rijmenants ini menggunakan Visual Basic yang befungsi untuk membuat virtual password (password sementara, untuk ditampung agar bisa digunakan login) dan juga salah satu cara terbaik agar password tidak direkam keylogger, mouse capture dan program sejenisnya.

Projek ini terdiri dari 4 file yaitu frmDemo.frm, frmEnter.frm, Module1.bas dan Password.vbp



Source code untuk file frmDemo.frm
VERSION 5.00
Begin VB.Form frmDemo
BorderStyle = 1 'Fixed Single
Caption = "Virtual password menggunakan VB by D. Rijmenants"
ClientHeight = 2145
ClientLeft = 45
ClientTop = 330
ClientWidth = 6390
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2145
ScaleWidth = 6390
StartUpPosition = 2 'CenterScreen
Begin VB.Frame Frame2
Caption = "Login"
Height = 1935
Left = 3240
TabIndex = 2
Top = 120
Width = 3015
Begin VB.CommandButton cmdEnter
Caption = "Login"
Height = 495
Left = 720
TabIndex = 3
Top = 1080
Width = 1815
End
Begin VB.Label Label4
Alignment = 2 'Center
Caption = "Klik untuk memasukkan password dan melakukan pengecekan apakah password valid"
Height = 735
Left = 240
TabIndex = 5
Top = 360
Width = 2655
End
End
Begin VB.Frame Frame1
Caption = "Ubah Password"
Height = 1935
Left = 120
TabIndex = 0
Top = 120
Width = 3015
Begin VB.CommandButton cmdNew
Caption = "Ganti Password"
Height = 495
Left = 600
TabIndex = 1
Top = 1080
Width = 1815
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "Klik tombol dibawah ini untuk mengubah password default ""TEST"""
Height = 495
Left = 120
TabIndex = 4
Top = 480
Width = 2775
End
End
End
Attribute VB_Name = "frmDemo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub Form_Load()
strSecretCode = "TEST" 'password default
End Sub

Private Sub cmdEnter_Click()
frmEnter.Show (vbModal)
If strEnteredCode = "" Then Exit Sub
If strEnteredCode = strSecretCode Then
MsgBox "Password yang anda masukkan benar", vbInformation
Else
MsgBox "Maaf, password salah", vbCritical
End If

End Sub

Private Sub cmdNew_Click()
Dim strTmp As String
Dim ret As Integer
frmEnter.Show (vbModal)
If strEnteredCode = "" Then Exit Sub
strTmp = strEnteredCode
'confirm the new code
ret = MsgBox("Harap konfirmasi password baru anda, masukkan sekali lagi", vbOKCancel + vbExclamation)
If ret = vbCancel Then Exit Sub
frmEnter.Show (vbModal)
If strEnteredCode = strTmp Then
'ubah password lama jadi baru
strSecretCode = strEnteredCode
MsgBox "Password anda sukses diganti!", vbInformation
Else
MsgBox "Password pertama dan kedua tidak sama, ulangi lagi", vbCritical
End If
End Sub


Private Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single)

End Sub


Source code untuk file frmEnter.frm
VERSION 5.00
Begin VB.Form frmEnter
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Dialog
ClientHeight = 2400
ClientLeft = 45
ClientTop = 45
ClientWidth = 1905
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
MousePointer = 99 'Custom
ScaleHeight = 2400
ScaleWidth = 1905
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 1680
Top = 960
End
Begin VB.Label lblMove
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
Caption = "gerakkan kursor mouse anda dikotak ini untuk membuka ""keyboard"""
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 1455
Left = 240
TabIndex = 39
Top = 240
Width = 1455
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
Caption = "A.."
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 225
Index = 39
Left = 240
MousePointer = 99 'Custom
TabIndex = 40
Top = 1750
Width = 300
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
Caption = "OK"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 240
Index = 38
Left = 240
MousePointer = 99 'Custom
TabIndex = 38
Top = 2040
Width = 1455
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
Caption = "Batal"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 225
Index = 37
Left = 900
MousePointer = 99 'Custom
TabIndex = 37
Top = 1750
Width = 775
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
Caption = "RE"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 225
Index = 36
Left = 575
MousePointer = 99 'Custom
TabIndex = 36
Top = 1750
Width = 300
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 35
Left = 1440
MousePointer = 99 'Custom
TabIndex = 35
Top = 1440
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 34
Left = 1200
MousePointer = 99 'Custom
TabIndex = 34
Top = 1440
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 33
Left = 960
MousePointer = 99 'Custom
TabIndex = 33
Top = 1440
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 32
Left = 720
MousePointer = 99 'Custom
TabIndex = 32
Top = 1440
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 31
Left = 480
MousePointer = 99 'Custom
TabIndex = 31
Top = 1440
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 30
Left = 240
MousePointer = 99 'Custom
TabIndex = 30
Top = 1440
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 29
Left = 1440
MousePointer = 99 'Custom
TabIndex = 29
Top = 1200
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 28
Left = 1200
MousePointer = 99 'Custom
TabIndex = 28
Top = 1200
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 27
Left = 960
MousePointer = 99 'Custom
TabIndex = 27
Top = 1200
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 26
Left = 720
MousePointer = 99 'Custom
TabIndex = 26
Top = 1200
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 25
Left = 480
MousePointer = 99 'Custom
TabIndex = 25
Top = 1200
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 24
Left = 240
MousePointer = 99 'Custom
TabIndex = 24
Top = 1200
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 23
Left = 1440
MousePointer = 99 'Custom
TabIndex = 23
Top = 960
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 22
Left = 1200
MousePointer = 99 'Custom
TabIndex = 22
Top = 960
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 21
Left = 960
MousePointer = 99 'Custom
TabIndex = 21
Top = 960
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 20
Left = 720
MousePointer = 99 'Custom
TabIndex = 20
Top = 960
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 19
Left = 480
MousePointer = 99 'Custom
TabIndex = 19
Top = 960
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 18
Left = 240
MousePointer = 99 'Custom
TabIndex = 18
Top = 960
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 17
Left = 1440
MousePointer = 99 'Custom
TabIndex = 17
Top = 720
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 16
Left = 1200
MousePointer = 99 'Custom
TabIndex = 16
Top = 720
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 15
Left = 960
MousePointer = 99 'Custom
TabIndex = 15
Top = 720
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 14
Left = 720
MousePointer = 99 'Custom
TabIndex = 14
Top = 720
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 13
Left = 480
MousePointer = 99 'Custom
TabIndex = 13
Top = 720
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 12
Left = 240
MousePointer = 99 'Custom
TabIndex = 12
Top = 720
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 11
Left = 1440
MousePointer = 99 'Custom
TabIndex = 11
Top = 480
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 10
Left = 1200
MousePointer = 99 'Custom
TabIndex = 10
Top = 480
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 9
Left = 960
MousePointer = 99 'Custom
TabIndex = 9
Top = 480
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 8
Left = 720
MousePointer = 99 'Custom
TabIndex = 8
Top = 480
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 7
Left = 480
MousePointer = 99 'Custom
TabIndex = 7
Top = 480
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 6
Left = 240
MousePointer = 99 'Custom
TabIndex = 6
Top = 480
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 5
Left = 1440
MousePointer = 99 'Custom
TabIndex = 5
Top = 240
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 4
Left = 1200
MousePointer = 99 'Custom
TabIndex = 4
Top = 240
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 3
Left = 960
MousePointer = 99 'Custom
TabIndex = 3
Top = 240
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 2
Left = 720
MousePointer = 99 'Custom
TabIndex = 2
Top = 240
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 1
Left = 480
MousePointer = 99 'Custom
TabIndex = 1
Top = 240
Visible = 0 'False
Width = 255
End
Begin VB.Label lblChar
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H00808080&
BorderStyle = 1 'Fixed Single
BeginProperty Font
Name = "Fixedsys"
Size = 9
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C0C0C0&
Height = 255
Index = 0
Left = 240
MousePointer = 99 'Custom
TabIndex = 0
Top = 240
Visible = 0 'False
Width = 255
End
End
Attribute VB_Name = "frmEnter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'*********************
' D. Rijmenants 2004
'*********************

Private intLastChar As Integer
Private strCode As String
Private strChar(35) As String
Private ScramKey() As Byte
Private strSeed As String
Private blnUpperCase As Boolean
Private blnSilentMode As Boolean
Private blnScramFlag As Boolean

Option Explicit

Private Sub ValidateCode()

' Tempat ini untuk mem-validasi password
strEnteredCode = strCode

End Sub

Private Sub Form_Activate()

'false agar tidak ada bunyi beep ketika validasi karakter
blnSilentMode = False
'true jika abjad menggunakan huruf besar
blnUpperCase = True

Me.Timer1.Enabled = False
intLastChar = -1
strCode = ""
strSeed = ""
Me.lblMove.Caption = vbCrLf & "gerakkan kursor mouse anda sampai berganti karakter"
blnScramFlag = False
Call ChangeCase
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'tahan ketika diatas keyboard
intLastChar = -1
End Sub

Private Sub lblChar_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If Index <> intLastChar Then
Me.Timer1.Interval = Int((2000) * Rnd + 1000)
Me.Timer1.Enabled = False
Me.Timer1.Enabled = True
intLastChar = Index
End If
End Sub


Private Sub lblMove_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static XP As Single
Static YP As Single
Static Skip As Integer
intLastChar = -1
If X = XP And Y = YP Then Exit Sub
XP = X: YP = Y
Skip = Skip + 1
If Skip < 3 Then Skip = Skip + 1: Exit Sub
Skip = 0
strSeed = strSeed & Chr((X Xor Y) And 255)
If Len(strSeed) > 34 Then
Me.lblMove.Visible = False
Call ScrambleChars
End If
End Sub

Private Sub Timer1_Timer()
'Timer bergerak jika kursor berhenti 1 detik
Me.Timer1.Enabled = False
If intLastChar = -1 Then Exit Sub 'jangan gerak ketika hanya lewat
Select Case intLastChar
Case 36
'reset
strCode = ""
Call ScrambleChars
Case 37
'batal
Call ClearAll
Me.Hide
Case 38
'validasi password
Call ValidateCode
Call ClearAll
Me.Hide
Case 39
'ganti huruf kecil besar
blnUpperCase = Not blnUpperCase
Call ChangeCase
Call ScrambleChars
Case Else
'tambah karakter
strCode = strCode & Me.lblChar(intLastChar).Caption
Call ScrambleChars
End Select
If Not blnSilentMode Then Beep
End Sub

Private Sub ScrambleChars()
' fill the square with random sequenced alfabet an figures
Dim i As Integer
Dim j As Integer
Dim tmp As Integer
Dim aKey As String
Dim k
ScramKey() = StrConv(strSeed, vbFromUnicode)
If blnScramFlag = False Then
blnScramFlag = True
For i = 0 To 35
strChar(i) = i
Next i
End If
For i = 0 To 35
j = (j + strChar(i) + ScramKey(i Mod Len(strSeed))) Mod 34
tmp = strChar(i)
strChar(i) = strChar(j)
strChar(j) = tmp
Next
'memindah karakter ke tabel
For i = 0 To 35
Me.lblChar(i).Visible = True
j = strChar(i)
If j < 26 Then
'set abjad
If blnUpperCase = True Then
Me.lblChar(i) = Chr(Asc("A") + j)
Else
Me.lblChar(i) = Chr(Asc("a") + j)
End If
Else
Me.lblChar(i) = Trim(Str(j - 26))
End If
Next i
End Sub

Private Sub ClearAll()
'hapus semua karakter
Dim i As Integer
For i = 0 To 35
Me.lblChar(i).Caption = ""
Me.lblChar(i).Visible = False
Next i
Me.lblMove.Visible = True
strCode = ""
End Sub

Private Sub ChangeCase()
'ubah label huruf kecil atau besar
Dim i As Integer
For i = 0 To 35
If blnUpperCase = True Then
lblChar(i).Caption = UCase(lblChar(i).Caption)
Else
lblChar(i).Caption = LCase(lblChar(i).Caption)
End If
Next i
If blnUpperCase = True Then
lblChar(39).Caption = "a.."
Else
lblChar(39).Caption = "A.."
End If
End Sub


Source code untuk file Module1.bas
Attribute VB_Name = "Module1"
'nilai yang masuk akan dipindahkan ke strEnteredCode
Public strEnteredCode As String
'password default tersimpan di strSecretCode
'password secara default adalah "TEST" yang sudah dideklarasikan di frmDemo
Public strSecretCode As String


Source code untuk file Password.vbp
Type=Exe
Form=frmDemo.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\..\WINDOWS\system32\stdole2.tlb#OLE Automation
Form=frmEnter.frm
Module=Module1; Module1.bas
IconForm="frmDemo"
Startup="frmDemo"
Command32=""
Name="Password"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="pasadenanet"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1

[MS Transaction Server]
AutoRefresh=1


Artikel Terkait:

{ 0 komentar... Skip ke Kotak Komentar }

Tambahkan Komentar Anda

Terimakasih sudah berkomentar dengan baik, sopan dan tidak mengandung spam di Blog, Silahkan Berkomentar Sesuai Artikel.
Maaf, memasukkan link ke dalam komentar akan DIHAPUS.

Regard's
=|| Arsha Wijaya ||=

Free SEO tools
 
Yahoo Messenger
Send Me IM!
Google Plus
Add Me To Your Circle!
Twitter
Follow Me!
Facebook
Add My Facebook

Mari Join

blog-indonesia.com

Komunitas

ASEAN Blogger
Cyber-PML Blog
Copyright 2012 Arsha Wijaya powered by Blogger - All Rights Reserved - Best View Using Nightly Build