logo
vbRad Home
Source Code
Book Reviews
Forum
Links
About Us
Contribute

Compare Databases with SQL Effects Clarity
 
 Cryptography, Certificates, Certificate Providers, Encryption/Decryption algorithms, Hash and more...

Posted on
2/24/2004
Author:
Brian Yule
Email:
Not Shown
Applies To OS:
NT, 9x, 2000
Product:
5, 6



By Brian Yule (byule at PembrokeTechnology.com)
Download the project (150 kb)

Cryptography has long been difficult to do with Visual Basic 6. This code changes all that. Provided below is a beautifully built and well thought out object implementation of various bits and pieces of cryptography puzzle.

The provides following features:

  • Shows how to encrypt/decrypt data, also known as two-way decryption
  • Shows how to sign data, known as one way decryption
  • Supplies the list of Providers on the local machine
  • Provides the list of Certificates on the local machine
  • Provides detailed information on each Certificate
  • Handles 3des, des, RC2, RC4, SHA1, MD2, MD4, MD5

The objects also provide helper methods intended to ease the development of windows application, like ability to load a list of certificates into a given combo box. Provided below is a quick example that display how easy it is to retrieve a list of Providers, Certificates, Containers and Algorithms. All this is also in the download. Right now, this code is being used to create Software License Keys.

The code comes as code group containing 2 projects. The 1st one is the Cryptography implementation itself. It is implemented as an ActiveX DLL. The second project is the test project that drives the Cryptography implementation and shows off various tricks uses for cryptography. To get started, simply double-click the g.vbg file.

Add the following to a Form
Private Sub btnLoadStuff_Click()
    'load list of providers into a combo box
    providers.LoadComboBox Combo1.hWnd
    
    'load a list of containers into a combo box
    providers.Item(Combo1.ListIndex).apiLoadContainers Combo2.hWnd
    
    'load a list of available algorithms into a combo box
    providers.Item(Combo1.ListIndex).apiLoadAlgorithms Combo3.hWnd
    
    'verify that the provided password is correct
    hash.Verify byteSignature, signatureKey
End Sub

Download the project (150 kb)





Add Your Comment  

Name: Email Address: all fields optional
Notify me via email when someone responds to this message (valid email required).

Enter the word:
 



Comments
#1. By Anonymous. Posted on 2/8/2006 5:36:35 AM
Thanks man. This code was exactly what I was looking for.

#2. By mathew. Posted on 3/3/2006 11:34:49 AM
Hey I downloaded it and double clicked the g.vbg file but its giving me an error "invalid commandline argumen" how to get the project up and running ?


mathew

#3. By rizzo. Posted on 3/4/2006 5:17:42 AM
Answer to #2. The zip file has folders in its structure. Make sure you unzip with the folder structure intact. I just tried it and it works.

#4. By mike. Posted on 3/20/2006 8:49:10 PM
Can't download the file....when I click on the 'download' link...got to a blank page.

Thanks.

#5. By Anonymous. Posted on 3/21/2006 5:45:00 AM
I download it fine. Email the sysadmin (email at the bottom of the page). They've helped me out before.

#6. By Jilvir. Posted on 5/15/2006 6:49:21 AM
Is there a exaple code on this that can encrypt and decrypt file??? not only a text in the text box of this project???

your reply is highly appreciated...
Jilvir

#7. By CT. Posted on 6/29/2007 7:47:58 PM
Code works great.

Why don't you add your name and coordinates in the code? I downloaded it, but found it very hard afterwards to find out where I got it from.

#8. By AB. Posted on 9/7/2009 11:39:05 PM
Tank you
I am projects algorithm encryption
i need help pleas send code visual baisc 6 rsa and rc4 vigner