Home All Groups Group Topic Archive Search About

Asymetric Key Pairs

Author
23 Jul 2005 9:45 PM
Chris Kennedy
I've seen some code  which makes perfect sense, but what namespace is the
encryption class. Furthermore, when I create my key pair how the distribute
the public key.

Dim asym As New Encryption.Asymmetric()
Dim pubkey As New Encryption.Asymmetric.PublicKey()
Dim privkey As New Encryption.Asymmetric.PrivateKey()
asym.GenerateNewKeyset(pubkey, privkey)
Dim secret As String = "ancient chinese"
Dim encryptedData As Encryption.Data
encryptedData = asym.Encrypt(New Encryption.Data(secret), pubkey)
Dim decryptedData As Encryption.Data
Dim asym2 As New Encryption.Asymmetric()
decryptedData = asym2.Decrypt(encryptedData, privkey)

Author
26 Jul 2005 6:19 AM
Clemens Reijnen
You can extract the public key from the keypair with sn.exe
namespace: System.Security.Cryptography

Show quoteHide quote
"Chris Kennedy" wrote:

> I've seen some code  which makes perfect sense, but what namespace is the
> encryption class. Furthermore, when I create my key pair how the distribute
> the public key.
>
> Dim asym As New Encryption.Asymmetric()
> Dim pubkey As New Encryption.Asymmetric.PublicKey()
> Dim privkey As New Encryption.Asymmetric.PrivateKey()
> asym.GenerateNewKeyset(pubkey, privkey)
> Dim secret As String = "ancient chinese"
> Dim encryptedData As Encryption.Data
> encryptedData = asym.Encrypt(New Encryption.Data(secret), pubkey)
> Dim decryptedData As Encryption.Data
> Dim asym2 As New Encryption.Asymmetric()
> decryptedData = asym2.Decrypt(encryptedData, privkey)
>
>
>