HomeClick here for more advertising information!
Latest Forum Posts
Newegg coming to Canada by shc-boomer
posted 1 hour and 51 minutes ago, with 1 replies.

Acer Aspireone by shc-boomer
posted 4 hours and 21 minutes ago, with 14 replies.

CoD4 Multiplayer by shc-boomer
posted 4 hours and 56 minutes ago, with 48 replies.

Post your computer + accessories photos by shc-boomer
posted 5 hours and 11 minutes ago, with 907 replies.

CoD4 PS3 on HDTV by lukerman
posted 10 hours and 27 minutes ago, with 11 replies.

[Funny Video] Yo Gabba Gabba Tummy Song ... by Mindovermaster
posted 17 hours and 4 minutes ago, with 1 replies.

[Newegg] Hard Drive Extravaganza (Free S... by Mindovermaster
posted 1 day and 1 hour ago, with 3 replies.

FAQ : how to convert dvd and video to zu... by chconline
posted 1 day and 1 hour ago, with 2 replies.

FAQ : how to rip DVD and convert Video t... by Agent47
posted 1 day and 15 hours ago, with 4 replies.

Lol Link in Box name ripoff by Mindovermaster
posted 1 day and 21 hours ago, with 7 replies.


Forum Login

Forum Login | Register

Click here to login only if you are using specific APH Main facilities (Forum and APH Main accounts are separate). Otherwise, register or login to our forums using links provided above.


Support APH Networks

Running APH Networks requires lots of time and money. (Please see our 2008 Monthly Budget.) If you appreciate our hard work and want to support us financially, any amount you donate is greatly appreciated for us to continue! Click here for more info.


Who's online
There are currently 2 users and 2191 guests online.

Tutorials | VB6: Encryption ActiveX Control

Tutorials | VB6: Encryption ActiveX Control
Submitted by chconline on Saturday, October 15, 2005 - 07:04 Tutorials

Author: Lord Nikon
Date: October 15, 2005

Well, I tried my hands at making an OCX (ActiveX Control) with VB6 for encryption. I have to say it came out pretty well even though the encryption algorithm is pretty easy to figure out.

I won't give out the source for the OCX file but I'll show you how to use the Control in the VB6.

Ok let's start by first downloading the ZIP file with the OCX in it. Unzip it and put the OCX in the system32 folder of your computer. Make a new standard EXE and press CTRL+T in the components. In the components menu choose NikonEncryption:

Download: ZIP File with OCX file and sample of the program.

Now there will be a new item in the toolbar:

Draw some new controls on the form so it looks something like this:

Name them whatever you want.

In the NikonCrypto1 decrypted event add this code:

Private Sub NikonCrypto1_decrypted(StrDecryptedText As String)
   MsgBox "The decrypted message is " + StrDecryptedText, vbOKOnly + vbInformation, "Test Encryption"
End Sub

In the NikonCrypto1 encrypted event add this code:

Private Sub NikonCrypto1_encryption(StrEncryptedText As String)
MsgBox "The encrypted message is " + StrEncryptedText, vbOKOnly + vbInformation, "Test Encryption"
End Sub

Add this in the NikonCrypto1 keychanged event:

Private Sub NikonCrypto1_keychanged()
MsgBox "The new key is " + NikonCrypto1.Key, vbOKOnly + vbInformation, "Test Encryption"
End Sub</b>
In the Encrypt button add this code:
<b>Private Sub cmdencrypt_Click()
NikonCrypto1.Key = txtcryptkey.Text
If Len(txtmessage.Text) > 0 Then
   NikonCrypto1.Message = txtmessage.Text
   txtcrypt.Text = NikonCrypto1.Encryption
End If
End Sub

What this code does is that it makes the NikonCrypt1 key what you type in the key text box. If someone wrote something in the message box then, that's what the message property of NikonCrypto1. Same goes for the encryption string.

Add this code in the decrypt button:

Private Sub cmddecrypt_Click()
NikonCrypto1.Key = txtcryptkey.Text
If Len(txtcrypt.Text) > 0 Then
   NikonCrypto1.Encryption = txtcrypt.Text
   txtmessage.Text = NikonCrypto1.Decrypt
   End If
End Sub

What this code does is if the someone wrote something in the Encryption text box, that would be the value of the nikoncrypto1 encryption property and same goes for the message and encryption key.

Add this code in the Exit button:

Private Sub cmdclose_Click()
Unload Me
End Sub

Simple just closes the program.


Subject: 
correction
Author: 
Anonymous APH Reader
Date: 
Tue, 2006-05-16 18:42


Private Sub NikonCrypto1_encrypted(StrEncryptedText As String)

you've posted that on the web, but on tha sample you have attached you wrote the following instead. that is why i was wondering your code did not work.


Private Sub NikonCrypto1_encryption(StrEncryptedText As String)


[ login or register to post comments ]

Subject: 
Re: correction
Author: 
chconline
Date: 
Tue, 2006-05-16 19:52

Thanks. Corrected :)


[ login or register to post comments ]

Subject: 
one of these things went bad
Author: 
Anonymous APH Reader
Date: 
Tue, 2006-10-03 21:30

one of these things went bad on me. it doesn't recognize the publisher. i got as far as pasting the ocx into the system 32 folder. now i'm stuck.


[ login or register to post comments ]

Poll




Sponsored Ads





:: Copyright 1998-2008 APH Networks. :: Copyright | Privacy Policy ::
This site is best viewed when your monitor's resolution is set to 1024x768 or higher.
Currently running on APH.CMS.