by Chris Dwinell (4 Submissions)
Category: Encryption
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (5 Votes)
This is a small example of how to create an MD5 hash and turn it into a barcode which could be used also as a password verification system.
Example: you could take the generated barcode, save it to a file, then when a user types in their password, the program would verify it by comparing the saved barcode to the one generated by the user logging in.
I appologize ahead of time for not commenting the code. It was an idea that just popped into my head, so I threw together in a few minutes. On a side note, the MD5 class I included is not my work. It was one I found on the internet and had saved in my archive, so I don't know who or where I got it from.
API DeclarationsPrivate Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long
Private Declare Function DeleteObject Lib "gdi32.dll" (ByVal hObject As Long) As Long
Private Declare Function FillRect Lib "user32.dll" (ByVal hDC As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Private Declare Function SetPixel Lib "gdi32.dll" Alias "SetPixelV" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long