Link to home
Start Free TrialLog in
Avatar of SoLost
SoLostFlag for New Zealand

asked on

How to use PGP key files with VB.NET PGP Encryption

Hi there,
I am looking at implementing PGP encryption in VB.NET.

I have gone through the examples of using Asymmetric Encryption and the RSA Encryption class on the understanding that this is the same as PGP encryption.  Everything works well and as expected.

However

The Public and Private key files in VB.NET are of an XML format and the PGP key files that I have been supplied with to use are in another format which I have been told is more common in the world of PGP encryption.

Without using a third party solution is there a way that I can use these PGP keys with VB.NET's RSA encryption routines?

Samples of the key files are below.

Thanks
### VB.NET Sample Public Key File ###

<RSAKeyValue>
    <Modulus>
9WpImJTydSmkgudTrWSF83H8gGJ8UrkdoPQtPLRUA0t4+VeIIggmiUtXPczdvn1ORGvFfM69Ta8ltyRW2peh17mscowkoYSRO6DusqiQgplQknVKJ4fB93/IpmgrY8lBmjx+yIZWIATOIltO8JolQVXWUZsiyxeA5oA23cXc8ws=
    </Modulus>
    <Exponent>
        AQAB
    </Exponent>
</RSAKeyValue>



### Sample Key File that I am trying to use ###

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: PGP Desktop 9.6.0 (Build 142) - www.pgp.com

mQENBELA1YgBCADosrXZRSOjJssqlD37nKck41F/2vaqJefALM2YpSoXCAl7wvAw
uHs2UbHZjd5wSMDa/Kv4y/nyBLixlg3Qwt9x9yHMOpWa8zyjkg6QBgsVr7k23WGr
MMdO2ufG0hh8v4PxgfRzKE8c5ls/ZAKaZRsMETB9mX03xSpSr/Us7t2KMeVMrKcq
...
...
5qpfoUz1BCECdY6xpCva37Xm10WMUtXiQHRep3riC3Nrr9CbGTI82JZoIOI03AvT
mipTsG4Iz7wTNZvtfJhmtUtenvfSoiQvq0MdB2ej5nNa8nyd1JPQYV0AOPmaVBLT
NIU23sneijWMPwyMVrNe
=WzUo
-----END PGP PUBLIC KEY BLOCK-----

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
if u need help converting the code to vb.net u can use the following on-line conversion website:
http://www.developerfusion.com/tools/convert/vb-to-csharp/
do you consider .Net a 3rd party solution?
you can grab the relevant code and use it.
>>The nature of EE is such that awarding points must only be done for tested and verified solutions. In many cases, without a suitable response from the Author to indicate this, we cannot be sure a solution is indeed working as originally requested.

in other words, the author can abandon the question once he got the solution he was expecting and also get full refund.
if authors would know that they gonna lose the points if they abandon their question maybe they will give the experts that devote their spare time to help them, some degree of respect.

in my opinion, the nature of EE as you described above serves a degree of injustice with the experts.
@Vee_Mod

>>I encourage you to actually read what is posted. Please note the 'method' by which this question is being closed:
"Vee_Mod has requested that this question be deleted without refund..."

i read it carefully and couldn't find the post you've mentioned.
there's no a single post in this thread where the sentence "this question be deleted without refund" can be found.
that explains it, thank you.