Click here to Skip to main content
15,891,248 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: csv => txt file Pin
dubscat25-Oct-12 7:22
dubscat25-Oct-12 7:22 
GeneralRe: csv => txt file Pin
ChandraRam25-Oct-12 7:25
ChandraRam25-Oct-12 7:25 
GeneralRe: csv => txt file Pin
dubscat25-Oct-12 7:39
dubscat25-Oct-12 7:39 
GeneralRe: csv => txt file Pin
ChandraRam25-Oct-12 7:44
ChandraRam25-Oct-12 7:44 
GeneralRe: csv => txt file Pin
dubscat25-Oct-12 8:53
dubscat25-Oct-12 8:53 
GeneralRe: csv => txt file Pin
ChandraRam26-Oct-12 3:04
ChandraRam26-Oct-12 3:04 
GeneralRe: csv => txt file Pin
dubscat26-Oct-12 3:25
dubscat26-Oct-12 3:25 
QuestionECDiffieHellmanCng & CngKey Usage Pin
Dominick Marciano21-Oct-12 15:54
professionalDominick Marciano21-Oct-12 15:54 
I'm writing an application that currently uses RSA public-key encryption. However, for users using newer computers, I want to offer the ability to use ECDH (Elliptic Curve Diffie-Hellman) as this seems to have many advantages over RSA. I've been over the MSDN articles and have tried search Google and CodeProject to figure out what I'm trying to do, but no luck.

Basically the application should do the following when starting up:

1. Check if the system supports ECDH. If it does continue on, otherwise create RSA keys.
2. Check if ECDH keys have already been created using a specified name.
2a. If the ECDH keys exist with the specified name then load them into an object to use within the application
2b. If the ECDH keys do not exist with the specified name then create ECDH keys (which I believe should be a CngKey object)

I've figure out how to make sure the ECDH keys can be created and even create them. However I can't figure out how to do the following:

1. Load the keys into an ECDH object. I check for the keys and load them like this:
VB
If CngKey.Exist(keyName) then
    Dim key as CngKey = CngKey.Open(keyName)
End If

However once I have a CngKey object how to I apply that to an ECDH object (the key property of an ECDH object is read-only)?

2. I can't seem to delete a key once it is created. I tried the following:
VB
Dim b As Boolean = CngKey.Exists(keyName)
Dim key As CngKey = CngKey.Open(keyName)
key.Delete()
b = CngKey.Exists(keyName)

If I run the above code, the second time I check if the key exist using b = CngKey.Exists(keyName) it always return true. Reading the MSDN documentation, it seems that when you call the CngKey.Delete method, it just prevents the CngKey object from being used. How can I actually delete the key permanently? What do I need to replace key.Delete() with so when b = CngKey.Exists(keyName) is called the second time it would actually return false? Or is there no way to actually permanently delete a named key?

Any other documentation, articles, links, etc. that shows how to use ECDH in VB.NET would be greatly appreciated. In the key I'm just trying to find how to load and save ECDH keys like RSA keys, so my program has multiple options.

Thanks in advanced for any help you can provided.
Questiondeployment Pin
Dirquez21-Oct-12 9:21
Dirquez21-Oct-12 9:21 
AnswerRe: deployment Pin
Richard MacCutchan21-Oct-12 22:03
mveRichard MacCutchan21-Oct-12 22:03 
AnswerRe: deployment Pin
Dave Kreskowiak22-Oct-12 2:13
mveDave Kreskowiak22-Oct-12 2:13 
Questionbackround picture in windows aero theme Pin
Syafrie00719-Oct-12 18:59
Syafrie00719-Oct-12 18:59 
Questiondo loop hang and not resopnding while running langtime.how rectify this Pin
leostalin9117-Oct-12 23:18
leostalin9117-Oct-12 23:18 
AnswerRe: do loop hang and not resopnding while running langtime.how rectify this Pin
Eddy Vluggen17-Oct-12 23:31
professionalEddy Vluggen17-Oct-12 23:31 
AnswerRe: do loop hang and not resopnding while running langtime.how rectify this Pin
Syafrie00719-Oct-12 19:03
Syafrie00719-Oct-12 19:03 
AnswerRe: do loop hang and not resopnding while running langtime.how rectify this Pin
Syafrie00719-Oct-12 19:03
Syafrie00719-Oct-12 19:03 
GeneralRe: do loop hang and not resopnding while running langtime.how rectify this Pin
Dave Kreskowiak20-Oct-12 3:58
mveDave Kreskowiak20-Oct-12 3:58 
GeneralRe: do loop hang and not resopnding while running langtime.how rectify this Pin
josephSurgeon31-Oct-12 4:22
josephSurgeon31-Oct-12 4:22 
Question[SOLVED] Getting System.StackOverflowException Pin
AmbiguousName15-Oct-12 19:38
AmbiguousName15-Oct-12 19:38 
AnswerRe: [SOLVED] Getting System.StackOverflowException Pin
Jay Royall19-Oct-12 1:10
Jay Royall19-Oct-12 1:10 
QuestionVS 2012 - Install Shield Pin
No-e15-Oct-12 6:10
No-e15-Oct-12 6:10 
AnswerRe: VS 2012 - Install Shield Pin
Dave Kreskowiak15-Oct-12 7:44
mveDave Kreskowiak15-Oct-12 7:44 
Questionhaving problems with program to merge sort a given set of input Pin
benkazy101415-Oct-12 0:23
benkazy101415-Oct-12 0:23 
QuestionRe: having problems with program to merge sort a given set of input Pin
Eddy Vluggen15-Oct-12 0:50
professionalEddy Vluggen15-Oct-12 0:50 
AnswerRe: having problems with program to merge sort a given set of input Pin
benkazy101415-Oct-12 1:36
benkazy101415-Oct-12 1:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.