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

SoLost
SoLost used Ask the Experts™
on
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

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Full stack Software Engineer
Commented:
u have a complete .NET (C#) PGP implementation in codeproject, check the following link:
http://www.codeproject.com/KB/security/sharpprivacy.aspx?df=100&forumid=15716&exp=0&select=573797
Meir RivkinFull stack Software Engineer

Commented:
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/
Meir RivkinFull stack Software Engineer

Commented:
do you consider .Net a 3rd party solution?
you can grab the relevant code and use it.
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Meir RivkinFull stack Software Engineer

Commented:
>>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.
Meir RivkinFull stack Software Engineer

Commented:
@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.
Meir RivkinFull stack Software Engineer

Commented:
that explains it, thank you.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial