GnuPG Wrapper with C#

14,088

You can try using my open source and free GnuPG wrapper for C# (and VB.NET). All the code is licensed via MIT, non-GPL restrictions. You can find the release with source code at CodePlex. Look for the Alpha release to find the GPG library.

http://biko.codeplex.com/

Example:

  GnuPG gpg = new GnuPG();

  gpg.Recipient = "[email protected]";
  FileStream sourceFile = new FileStream(@"c:\temp\source.txt", FileMode.Open); 
  FileStream outputFile = new FileStream(@"c:\temp\output.txt", FileMode.Create);

  // encrypt the data using IO Streams - any type of input and output IO Stream can be used
  gpg.Encrypt(sourceFile, outputFile);
Share:
14,088
iburlakov
Author by

iburlakov

.net developer

Updated on June 06, 2022

Comments

  • iburlakov
    iburlakov almost 2 years

    I use GnuPG and C# to encrypt files with imported public keys. But when I try to make encryption, GnuPG encrypt file with public key of main user. I'm sure that I pass right recipient.

  • Umamaheswaran
    Umamaheswaran over 11 years
    Hi, this solution works for a console application when i'm running this from a Windows service im getting error as gpg2.exe has stopped working
  • Marcel Popescu
    Marcel Popescu over 11 years
    This component appears abandoned... there's a comment from Sep 9, 2012 saying it has moved to the starksoft.com site, but there's nothing about it there (and gets redirected to yet another site)
  • Benton
    Benton over 11 years
    The code is all hosted under CodePlex. Just go there and get the Alpha release of the Biko library. It is not abandoned.
  • Jayd
    Jayd over 10 years
    The Biko Library seems to be just FTP. How is that helpful to the question? It doesn't mention PGP, onenPGP, GnuPG or GPG anywhere on the site? Maybe the purpose of the project has changed?
  • Holger Böhnke
    Holger Böhnke almost 3 years
    Looks the project migrated to github: github.com/bentonstark/starksoft-aspen There seems to be a nuget as well: nuget.org/packages/starksoft.aspen/1.0.0