473,408 Members | 2,032 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Encryption

I have to make an Encrytion function that works for both VB.NEt and VB 6. I
use the System.Security.Cryptography in VB.NET and I want to use the same
type of functions in VB6.

I USE DPAPI to store some keys in registry and I want to use the same keys
both in VB6 and VB.NET. The DPAPI works fine in both. The problem is the
Encryprion/Decryption using advapi.dll

I have converted the classes from
http://msdn.microsoft.com/library/de...SecNetHT10.asp
to VB and I want the same classes/methods in VB6.

Anyone who has the same problem ? Any tips, hints ?

--
Regards
Robert Vabo
Gecko AS
www.gecko.no
Nov 20 '05 #1
3 2251
One easy way if you don't mind having your VB6 app relying on the presence
of .NET framework is by putting your VB.NET encryption code in a COM class
(ie instead of add a new class in VB.NET, you add a new COM class), build,
and add a reference in your VB6 app to that COM class. You will need both
sets of binaries (VB.NET and VB6) as well as .NET framework to run your VB6
app but it should work.

Nov 20 '05 #2
Thanks for the answer.
I have now made the component a COM component. I call it from VB6 but I get
this error message :
"Function or interface marked as restricted, or the function uses an
Automation type not supported in Visual Basic". Any suggestions.
I have made all the methods public.
--
Regards
Robert Vabo
Gecko AS
www.gecko.no

"Ting Liang (MSFT)" <tl****@online.microsoft.com> skrev i melding
news:vA**************@cpmsftngxa06.phx.gbl...
One easy way if you don't mind having your VB6 app relying on the presence
of .NET framework is by putting your VB.NET encryption code in a COM class
(ie instead of add a new class in VB.NET, you add a new COM class), build,
and add a reference in your VB6 app to that COM class. You will need both
sets of binaries (VB.NET and VB6) as well as .NET framework to run your VB6 app but it should work.

Nov 20 '05 #3
You should create a VB.net ClassLibrary project (named ClassLibrary1),
remove Class1 and create a new COM class (ComClass1). Implement your
encryption function in ComClass1, eg Public Function Encrypt(...). Build
ClassLibrary1 project. After building you should be able to find
ClassLibrary1 in VB6's Project->References dialog. Check it in the dialog.
You should then be able to write something like Dim x as New
ClassLibrary1.Class1, and make calls x.Encrypt(...) to it.

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Cliff | last post by:
We are trying to connect to 3 different Oracle databases using MS Access as the front-end and ODBC as the connection. The problem that we are having is that 1 of the databases requires a...
113
by: Bonj | last post by:
I was in need of an encryption algorithm to the following requirements: 1) Must be capable of encrypting strings to a byte array, and decyrpting back again to the same string 2) Must have the same...
7
by: Alan Silver | last post by:
Hello, I am writing a page where sensitive data is collected (over SSL) and stored in a database. I have been looking at the .NET encryption classes, but am a bit confused as to which is best...
2
by: Sumit Gupta | last post by:
Can anyone please tell me how to encrpt string or any kind of Data. Also the Algorithm of Compression. Any Link tutorial etc. Like : Zip or RAR Formats etc.
9
by: sweety | last post by:
Dear All, How to encrypt a C data file and make binary file and then have to read a bin file at run time and decrypt the file and have to read the data. Any help to achive this pls. Would be...
4
by: pintu | last post by:
Hello everybody.. I hav some confusion regarding asymmetric encryption.As asymmetric encryption it there is one private key and one public key.So any data is encrypted using private key and the...
1
by: =?Utf-8?B?bWljcm9ob2Y=?= | last post by:
Short version: Is there a way to configure (preferably programmatically) the max encryption strength that will be used by the framework when connecting to a particular SSL-protected web service? ...
11
by: John Williams | last post by:
I've written a simple program to do XOR encryption as my first foray into understanding how encryption works. The code compiles fine, however it segmentation faults on every run. using gdb to...
22
by: j1mb0jay | last post by:
I have had to create a simple string encryption program for coursework, I have completed the task and now have to do a write up on how it could be improved at a later date. If you could look...
19
by: klenwell | last post by:
Another request for comments here. I'd like to accomplish something like the scheme outlined at this page here: http://tinyurl.com/3dtcdr In a nutshell, the form uses javascript to hash...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.