PGP Zip Encrypted Files With C#

23 בינואר 2009

תגיות: , , , ,
64 תגובות

On a recent project here at Renaissance, we needed to send files over FTP to some third party vendor. One of the requirements was that the files had to be encrypted using PGP (Pretty Good Privacy). After some research we decided to use Bouncy Castle. Bouncy Castle is an open source C# implementation of the OpenPGP standard. It is available in Java as well.
An additional requirement was that the PGP Encrypted files needed to be signed as well.


If you have no background in cryptology or PGP and this sounds like gibberish, here’s a short simplified background on symmetric key encryption.


To share PGP encrypted files the sender and recipient both need two keys. One public and one private. The sender encrypts the file to send with the recipients public key and sign with his private key. Both parties then exchange public keys. Each party can decrypt using its own private key and it can verify who sent the file using the senders public key.


If this still sounds gibberish, I found this illustration on the LinomaSoftware site a good visual explanation. (never used it, just searched Google for PGP image)



With that out of the way, how hard can it be to encrypt and sign a file? Not very hard, but far too much code to write. We found a few samples online, but nothing I felt comfortable to use in our codebase. Credits to John Opincar who published a post on single pass encryption and signing. We used the blog post of his, the Bouncy test suites and a some trial and failure to get it working.


One of the issues with all the sample code out there, is that there are so many responsibilities squeezed together that unless you know what the code is doing beforehand, it is hard to grasp. It was to me at least. That might be partially related to me having no significant background in cryptology or PGP.


Lets see some code. No matter if I’m doing TDD or not, I always try to write the client code before the API. That way I shape the API from the point of view of the consuming code and avoid surprising and clunky interfaces later. I wanted the calling code to look like this.



private static void EncryptAndSign()


{


    PgpEncryptionKeys encryptionKeys = new PgpEncryptionKeys(


                                   PublicKeyFileName, PrivateKeyFileName, "PasswordOfMyPrivateKey");


    PgpEncrypt encrypter = new PgpEncrypt(encryptionKeys);


    using (Stream outputStream = File.Create(EncryptedFileName))


    {


        encrypter.EncryptAndSign(outputStream, new FileInfo(FileToEncrypt));


    }


}


From the sample code above you can see that we have separated Key management code from the actual encryption code. The PgpEncryptionKeys class instantiates and deals with the intricacies of key management. The PgpEncrypt class does this actual encryption. There were two reasons for this separation. The first is that key management is a separate concern conceptually. Another is that while we currently point to the location of the key files, we might want to change that in the future. I want to be able to change the way we instantiate the keys without touching the encryption code. No efforts were made at this point to create interfaces and/or abstract classes for evolution or extensibility. We’ll do that when/if we’ll need it.


Next we will have a look at the actual implementation. I will not walk through and explain all the code. We tried to make the code as self explanatory as possible. However, if you have no other background related to encryption and PGP besides this blog post, you should probably spend a few hours reading up on that before considering using this code. Treat this code As-Is with no commitment on my side to keep it up-to-date with bug fixes and improvements.



using System;


using System.IO;


using System.Linq;


using Org.BouncyCastle.Bcpg.OpenPgp;


namespace Renaissance.Common.Encryption


{


    public class PgpEncryptionKeys


    {


        public PgpPublicKey PublicKey { get; private set; }


        public PgpPrivateKey PrivateKey { get; private set; }


        public PgpSecretKey SecretKey { get; private set; }


        /// <summary>


        /// Initializes a new instance of the EncryptionKeys class.


        /// Two keys are required to encrypt and sign data. Your private key and the recipients public key.


        /// The data is encrypted with the recipients public key and signed with your private key.


        /// </summary>


        /// <param name="publicKeyPath">The key used to encrypt the data</param>


        /// <param name="privateKeyPath">The key used to sign the data.</param>


        /// <param name="passPhrase">The (your) password required to access the private key</param>


        /// <exception cref="ArgumentException">Public key not found. Private key not found. Missing password</exception>


        public PgpEncryptionKeys(string publicKeyPath, string privateKeyPath, string passPhrase)


        {


            if (!File.Exists(publicKeyPath))


                throw new ArgumentException("Public key file not found", "publicKeyPath");


            if (!File.Exists(privateKeyPath))


                throw new ArgumentException("Private key file not found", "privateKeyPath");


            if (String.IsNullOrEmpty(passPhrase))


                throw new ArgumentException("passPhrase is null or empty.", "passPhrase");


            PublicKey = ReadPublicKey(publicKeyPath);


            SecretKey = ReadSecretKey(privateKeyPath);


            PrivateKey = ReadPrivateKey(passPhrase);


        }


        #region Secret Key


        private PgpSecretKey ReadSecretKey(string privateKeyPath)


        {


            using (Stream keyIn = File.OpenRead(privateKeyPath))


            using (Stream inputStream = PgpUtilities.GetDecoderStream(keyIn))


            {


                PgpSecretKeyRingBundle secretKeyRingBundle = new PgpSecretKeyRingBundle(inputStream);


                PgpSecretKey foundKey = GetFirstSecretKey(secretKeyRingBundle);


                if (foundKey != null)


                    return foundKey;


            }


            throw new ArgumentException("Can't find signing key in key ring.");


        }


        /// <summary>


        /// Return the first key we can use to encrypt.


        /// Note: A file can contain multiple keys (stored in "key rings")


        /// </summary>


        private PgpSecretKey GetFirstSecretKey(PgpSecretKeyRingBundle secretKeyRingBundle)


        {


            foreach (PgpSecretKeyRing kRing in secretKeyRingBundle.GetKeyRings())


            {


                PgpSecretKey key = kRing.GetSecretKeys()


                    .Cast<PgpSecretKey>()


                    .Where(k => k.IsSigningKey)


                    .FirstOrDefault();


                if (key != null)


                    return key;


            }


            return null;


        }


        #endregion


        #region Public Key


        private PgpPublicKey ReadPublicKey(string publicKeyPath)


        {


            using (Stream keyIn = File.OpenRead(publicKeyPath))


            using (Stream inputStream = PgpUtilities.GetDecoderStream(keyIn))


            {


                PgpPublicKeyRingBundle publicKeyRingBundle = new PgpPublicKeyRingBundle(inputStream);


                PgpPublicKey foundKey = GetFirstPublicKey(publicKeyRingBundle);


                if (foundKey != null)


                    return foundKey;


            }


            throw new ArgumentException("No encryption key found in public key ring.");


        }


        private PgpPublicKey GetFirstPublicKey(PgpPublicKeyRingBundle publicKeyRingBundle)


        {


            foreach (PgpPublicKeyRing kRing in publicKeyRingBundle.GetKeyRings())


            {


                PgpPublicKey key = kRing.GetPublicKeys()


                    .Cast<PgpPublicKey>()


                    .Where(k => k.IsEncryptionKey)


                    .FirstOrDefault();


                if (key != null)


                    return key;


            }


            return null;


        }


        #endregion


        #region Private Key


        private PgpPrivateKey ReadPrivateKey(string passPhrase)


        {


            PgpPrivateKey privateKey = SecretKey.ExtractPrivateKey(passPhrase.ToCharArray());


            if (privateKey != null)


                return privateKey;


            throw new ArgumentException("No private key found in secret key.");


        }


        #endregion


    }


}


As you can see from the code and comments, PGP has a concept of key rings. In other words there can be many keys. We assume a single key.


Now to the PGP encryption class



using System;


using System.IO;


using Org.BouncyCastle.Bcpg;


using Org.BouncyCastle.Bcpg.OpenPgp;


using Org.BouncyCastle.Security;


namespace Renaissance.Common.Encryption


{


    /// <summary>


    /// Wrapper around Bouncy Castle OpenPGP library.


    /// Bouncy documentation can be found here: http://www.bouncycastle.org/docs/pgdocs1.6/index.html


    /// </summary>


    public class PgpEncrypt


    {


        private PgpEncryptionKeys m_encryptionKeys;


        private const int BufferSize = 0×10000; // should always be power of 2 


        /// <summary>


        /// Instantiate a new PgpEncrypt class with initialized PgpEncryptionKeys.


        /// </summary>


        /// <param name="encryptionKeys"></param>


        /// <exception cref="ArgumentNullException">encryptionKeys is null</exception>


        public PgpEncrypt(PgpEncryptionKeys encryptionKeys)


        {


            if (encryptionKeys == null)


                throw new ArgumentNullException("encryptionKeys", "encryptionKeys is null.");


            m_encryptionKeys = encryptionKeys;


        }


        /// <summary>


        /// Encrypt and sign the file pointed to by unencryptedFileInfo and


        /// write the encrypted content to outputStream.


        /// </summary>


        /// <param name="outputStream">The stream that will contain the


        /// encrypted data when this method returns.</param>


        /// <param name="fileName">FileInfo of the file to encrypt</param>


        public void EncryptAndSign(Stream outputStream, FileInfo unencryptedFileInfo)


        {


            if (outputStream == null)


                throw new ArgumentNullException("outputStream", "outputStream is null.");


            if (unencryptedFileInfo == null)


                throw new ArgumentNullException("unencryptedFileInfo", "unencryptedFileInfo is null.");


            if (!File.Exists(unencryptedFileInfo.FullName))


                throw new ArgumentException("File to encrypt not found.");


            using (Stream encryptedOut = ChainEncryptedOut(outputStream))


            using (Stream compressedOut = ChainCompressedOut(encryptedOut))


            {


                PgpSignatureGenerator signatureGenerator = InitSignatureGenerator(compressedOut);


                using (Stream literalOut = ChainLiteralOut(compressedOut, unencryptedFileInfo))


                using (FileStream inputFile = unencryptedFileInfo.OpenRead())


                {


                    WriteOutputAndSign(compressedOut, literalOut, inputFile, signatureGenerator);


                }


            }


        }


        private static void WriteOutputAndSign(Stream compressedOut,


            Stream literalOut,


            FileStream inputFile,


            PgpSignatureGenerator signatureGenerator)


        {


            int length = 0;


            byte[] buf = new byte[BufferSize];


            while ((length = inputFile.Read(buf, 0, buf.Length)) > 0)


            {


                literalOut.Write(buf, 0, length);


                signatureGenerator.Update(buf, 0, length);


            }


            signatureGenerator.Generate().Encode(compressedOut);


        }


        private Stream ChainEncryptedOut(Stream outputStream)


        {


            PgpEncryptedDataGenerator encryptedDataGenerator;


            encryptedDataGenerator =


                new PgpEncryptedDataGenerator(SymmetricKeyAlgorithmTag.TripleDes,
                                              new SecureRandom());


            encryptedDataGenerator.AddMethod(m_encryptionKeys.PublicKey);


            return encryptedDataGenerator.Open(outputStream, new byte[BufferSize]);


        }


        private static Stream ChainCompressedOut(Stream encryptedOut)


        {


            PgpCompressedDataGenerator compressedDataGenerator =


                new PgpCompressedDataGenerator(CompressionAlgorithmTag.Zip);


            return compressedDataGenerator.Open(encryptedOut);


        }


        private static Stream ChainLiteralOut(Stream compressedOut, FileInfo file)


        {


            PgpLiteralDataGenerator pgpLiteralDataGenerator = new PgpLiteralDataGenerator();


            return pgpLiteralDataGenerator.Open(compressedOut, PgpLiteralData.Binary, file);


        }


        private PgpSignatureGenerator InitSignatureGenerator(Stream compressedOut)


        {


            const bool IsCritical = false;


            const bool IsNested = false;


            PublicKeyAlgorithmTag tag = m_encryptionKeys.SecretKey.PublicKey.Algorithm;


            PgpSignatureGenerator pgpSignatureGenerator =


                new PgpSignatureGenerator(tag, HashAlgorithmTag.Sha1);


            pgpSignatureGenerator.InitSign(PgpSignature.BinaryDocument, m_encryptionKeys.PrivateKey);


            foreach (string userId in m_encryptionKeys.SecretKey.PublicKey.GetUserIds())


            {


                PgpSignatureSubpacketGenerator subPacketGenerator =
                   new PgpSignatureSubpacketGenerator();


                subPacketGenerator.SetSignerUserId(IsCritical, userId);


                pgpSignatureGenerator.SetHashedSubpackets(subPacketGenerator.Generate());


                // Just the first one!


                break;


            }


            pgpSignatureGenerator.GenerateOnePassVersion(IsNested).Encode(compressedOut);


            return pgpSignatureGenerator;


        }


    }


}


It should be clear from the code above, but one concept that helped understand the implementation of the Bouncy classes was that they basically just creates a pipeline of streams. We expressed these as XXX ChainXXX(innerStream){} where the ChainXXX methods take the stream to wrap and returns the wrapped stream. Encapsulating this concept into small ChainXXX classes made the resulting code much more readable IMHO.


Comments, corrections and improvements are welcome as always…

kick it on DotNetKicks.com

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. (*) שדות חובה מסומנים

64 תגובות

  1. LaPo31 בינואר 2009 ב 15:27

    Hi,

    thank you for your article. You wrote about to encrypt, but do you have also an example from decrypt an pgp file? You divide it with me?

    Thanks…

    Bye Ralf

    להגיב
  2. Kim31 בינואר 2009 ב 21:10

    No I don't since we only had to send data. I have been playing with the thought of expanding the code above with some more functionality.
    I thought of supporting at least:
    1) Encoding (more flexible than the one above) e.g including arbitrary text and not only files.
    2) Decode
    3) Key management.
    4) ???

    If there's enough demand I'll try to find the time to expand on this.

    Please leave a comment if you would like this and/or any feature you would like to see.

    להגיב
  3. LaPo2 בפברואר 2009 ב 12:01

    Hello Kim,

    thank's for your answer.
    It will be fine, if you expand your code sample.

    I have the problem, that i'm became an gpg file and i have to decrypt this file in a DotNet program. I have search about this in the web, with little succeed. Your blog was the only…

    Bye

    Ralf

    להגיב
  4. Firoz Ozman21 בפברואר 2009 ב 3:38

    Hi Kim

    This code so useful as I am working on exactly same stuff. Everything works fine except the last step where I am trying to convert the OutputStream to a Memorystream to be used inside the Pipeline. I get System.ObjectDisposedException: Cannot access a closed file.

    Please help as I need figure this out soon.

    Please mail me at firozozman@gmail.com

    Thanks
    Firoz Ozman

    להגיב
  5. Firoz Ozman21 בפברואר 2009 ב 5:59

    Kim,

    No worries.. I figured out it was coz of the test windows app I was using to test. I was accessing a file from Windows App and sending across to encrypt/sign.

    Hey I have a complete version of this ready.
    It does Encrypt/Decrypt and Encrypt with Sign. I will post this soon on http://www.firozozman.com.

    Take care
    Firoz Ozman

    להגיב
  6. Girish27 בפברואר 2009 ב 5:03

    Do you have the decrypted method too?

    להגיב
  7. Girish27 בפברואר 2009 ב 18:22

    I got the decrypt method working, used the one that is available in the BouncyCastle sample and wrote a wrapper around it. Works with both signed and unsigned. Shoot me a email if you want the code

    girishSIXSIX @ h0tma1l . c0m

    Tried to obfusicate it a little bit, replace SIX SIX with the number SIXTYSIX the 0's are o's and the 1 is a i

    להגיב
  8. Tracy17 באפריל 2009 ב 2:19

    Thank you for posting this. I am still trying to figure how this works. I had a dll that required keyid and no passPhrase but it encypts file in Unix format. We need PC format. Can you point me a direction on how to use bouncy castle without using passPhrase but use a keyid instead of getFirstPublicKey?

    Thank you.

    להגיב
  9. pavankumar6 במאי 2009 ב 16:03

    thnx for the code you ve given.but for pgpencryptionkeys you are passing the files right so can you please specify the file format.

    להגיב
  10. pavankumar8 במאי 2009 ב 13:38

    can u please provide code for decryption.

    להגיב
  11. Chris Porter11 במאי 2009 ב 22:54

    Thank you very much for this resource. My client was looking for the exact same functionality (file -> encryption -> ftp) so this was a perfect fit. I used the code almost completely as-is and it worked great. This code was combined with a small command line utility that supported the FTP side of things. We haven't done a full end-to-end test yet but I was successful in my own test environment.

    I will post in the future with the end-to-end results.

    להגיב
  12. Chris Porter29 ביולי 2009 ב 20:05

    Its been awhile since I have posted my initial comment but I wanted to give a follow-up. The code here worked with very few changes. After pretty extensive testing, I found nothing wrong with my implementation of this code or the BouncyCastle.Crypto library. I did have problems with the FTP library I'm using but that's a different topic.

    Thanks Kim!!

    להגיב
  13. Ian Patrick Hughes4 בנובמבר 2009 ב 19:54

    I used the C# Bouncy library for a PGP project over a year ago. Now that I have to revisit it, I am refreshing myself and see, lo and behold, I went down a very similar path. That's reassuring if nothing else.

    On the FTP side of things, what problems have you encountered? I have not found any issues using WinSCP in my managed code.

    להגיב
  14. Kim5 בנובמבר 2009 ב 0:43

    We have not encountered any issues with FTP so far. (running in production for a few months)
    The FTP upload is part of the application and we use the .NET FtpWebRequest. Most of the files are < 100MB and transferred over a high bandwidth line. In short, no issues…

    להגיב
  15. Tarek5 בנובמבר 2009 ב 16:13

    How can I get data from compressedOut (WrappedGeneratorStream)?
    It's still empty !

    להגיב
  16. Kim5 בנובמבר 2009 ב 19:47

    I'm not sure I understand your question. If you want to retrieve the original content (as it was before encryption) you can look at the samples included with Bouncy. There are many samples online.
    I haven't looked at the below link thoroughly, but it should get you started.
    http://karym6.blogspot.com/2009/06/pgp-decryption-with-c.html

    להגיב
  17. Tarek6 בנובמבר 2009 ב 8:39

    Thanks Kim for you reply.
    My question is when I run your "EncryptAndSign(..)" function, the stream compressedout is still empty !

    Is it a pb with my keys, please see below my key generator function :

    private static void ExportKeyPair(Stream secretOut, Stream publicOut,
    AsymmetricKeyParameter publicKey, AsymmetricKeyParameter privateKey,
    string identity, char[] passPhrase, bool armor)
    {
    if (armor)
    {
    secretOut = new ArmoredOutputStream(secretOut);
    }
    PgpSecretKey secretKey = new PgpSecretKey(PgpSignature.DefaultCertification,
    PublicKeyAlgorithmTag.RsaGeneral, publicKey, privateKey, DateTime.Now,
    identity, SymmetricKeyAlgorithmTag.TripleDes, passPhrase, null, null,
    new SecureRandom());
    secretKey.Encode(secretOut);
    secretOut.Close();
    if (armor)
    {
    publicOut = new ArmoredOutputStream(publicOut);
    }
    PgpPublicKey key = secretKey.PublicKey;
    key.Encode(publicOut);
    publicOut.Close();
    }

    public static void GenerateKey(string username, string password, string keyStoreUrl)
    {
    IAsymmetricCipherKeyPairGenerator kpg = new RsaKeyPairGenerator();
    kpg.Init(new RsaKeyGenerationParameters(BigInteger.ValueOf(0×13), new SecureRandom(), 1024, 8));
    AsymmetricCipherKeyPair kp = kpg.GenerateKeyPair();
    FileStream out1 =
    new FileInfo(string.Format("{0}secret.asc", keyStoreUrl)).OpenWrite();
    FileStream out2 = new FileInfo(string.Format("{0}pub.asc", keyStoreUrl)).OpenWrite();
    ExportKeyPair(out1, out2, kp.Public, kp.Private, username, password.ToCharArray(), true);
    }

    Thanks

    להגיב
  18. Kim7 בנובמבר 2009 ב 20:59

    Possibly, but it's hard for me to say without the source. Make sure the literal stream is being written to in WriteOutputAndSign(). What probably would be most helpful, is to run your code with the Bouncy code added as a project reference. Then you can step into
    signatureGenerator.Generate().Encode(compressedOut);" (the last line in WriteOutputAndSign and where compressedOut is written to)
    and maybe spot the problem.

    להגיב
  19. Samir23 באפריל 2010 ב 22:22

    The below definitely works….. Have tried it right now…

    public static void GenerateKey(string username, string password, string keyStoreUrl)

    {

    IAsymmetricCipherKeyPairGenerator kpg = new RsaKeyPairGenerator();

    kpg.Init(new RsaKeyGenerationParameters(BigInteger.ValueOf(0×13), new SecureRandom(), 1024, 8));

    AsymmetricCipherKeyPair kp = kpg.GenerateKeyPair();

    FileStream out1 =

    new FileInfo(string.Format("{0}secret.asc", keyStoreUrl)).OpenWrite();

    FileStream out2 = new FileInfo(string.Format("{0}pub.asc", keyStoreUrl)).OpenWrite();

    ExportKeyPair(out1, out2, kp.Public, kp.Private, username, password.ToCharArray(), true);

    out1.Close();
    out2.Close();
    }

    להגיב
  20. Mike5 במאי 2010 ב 14:11

    public class PGPEncryptDecrypt
    {
    /**

    * A simple routine that opens a key ring file and loads the first available key suitable for

    * encryption.

    *

    * @param in

    * @return

    * @m_out

    * @

    */
    private static PgpPublicKey ReadPublicKey(Stream inputStream)
    {

    inputStream = PgpUtilities.GetDecoderStream(inputStream);

    PgpPublicKeyRingBundle pgpPub = new PgpPublicKeyRingBundle(inputStream);

    //

    // we just loop through the collection till we find a key suitable for encryption, in the real

    // world you would probably want to be a bit smarter about this.

    //

    //

    // iterate through the key rings.

    //

    foreach (PgpPublicKeyRing kRing in pgpPub.GetKeyRings())
    {

    foreach (PgpPublicKey k in kRing.GetPublicKeys())
    {

    if (k.IsEncryptionKey)
    {

    return k;

    }

    }

    }

    throw new ArgumentException("Can't find encryption key in key ring.");

    }

    /**

    * Search a secret key ring collection for a secret key corresponding to

    * keyId if it exists.

    *

    * @param pgpSec a secret key ring collection.

    * @param keyId keyId we want.

    * @param pass passphrase to decrypt secret key with.

    * @return

    */
    private static PgpPrivateKey FindSecretKey(PgpSecretKeyRingBundle pgpSec, long keyId, char[] pass)
    {

    PgpSecretKey pgpSecKey = pgpSec.GetSecretKey(keyId);

    if (pgpSecKey == null)
    {

    return null;

    }

    return pgpSecKey.ExtractPrivateKey(pass);

    }

    /**

    * decrypt the passed in message stream

    */
    private static void DecryptFile(Stream inputStream, Stream keyIn, char[] passwd, string pathToSaveFile)
    {

    inputStream = PgpUtilities.GetDecoderStream(inputStream);

    try
    {

    PgpObjectFactory pgpF = new PgpObjectFactory(inputStream);

    PgpEncryptedDataList enc;

    PgpObject o = pgpF.NextPgpObject();

    //

    // the first object might be a PGP marker packet.

    //

    if (o is PgpEncryptedDataList)
    {

    enc = (PgpEncryptedDataList)o;

    }

    else
    {

    enc = (PgpEncryptedDataList)pgpF.NextPgpObject();

    }

    //

    // find the secret key

    //

    PgpPrivateKey sKey = null;

    PgpPublicKeyEncryptedData pbe = null;

    PgpSecretKeyRingBundle pgpSec = new PgpSecretKeyRingBundle(

    PgpUtilities.GetDecoderStream(keyIn));

    foreach (PgpPublicKeyEncryptedData pked in enc.GetEncryptedDataObjects())
    {

    sKey = FindSecretKey(pgpSec, pked.KeyId, passwd);

    if (sKey != null)
    {

    pbe = pked;

    break;

    }

    }

    if (sKey == null)
    {

    throw new ArgumentException("secret key for message not found.");

    }

    Stream clear = pbe.GetDataStream(sKey);

    PgpObjectFactory plainFact = new PgpObjectFactory(clear);

    PgpObject message = plainFact.NextPgpObject();

    if (message is PgpCompressedData)
    {

    PgpCompressedData cData = (PgpCompressedData)message;

    PgpObjectFactory pgpFact = new PgpObjectFactory(cData.GetDataStream());

    message = pgpFact.NextPgpObject();

    }

    if (message is PgpLiteralData)
    {

    PgpLiteralData ld = (PgpLiteralData)message;

    //string outFileName = ld.FileName;

    //if (outFileName.Length == 0)
    //{

    // outFileName = defaultFileName;

    //}

    Stream fOut = File.Create(pathToSaveFile);

    Stream unc = ld.GetInputStream();

    Streams.PipeAll(unc, fOut);

    fOut.Close();

    }

    else if (message is PgpOnePassSignatureList)
    {

    throw new PgpException("encrypted message contains a signed message – not literal data.");

    }

    else
    {

    throw new PgpException("message is not a simple encrypted file – type unknown.");

    }

    if (pbe.IsIntegrityProtected())
    {

    if (!pbe.Verify())
    {

    Console.WriteLine("message failed integrity check");

    }

    else
    {

    Console.WriteLine("message integrity check passed");

    }

    }

    else
    {

    Console.WriteLine("no message integrity check");

    }

    }

    catch (PgpException e)
    {

    Console.WriteLine(e);

    Exception underlyingException = e.InnerException;

    if (underlyingException != null)
    {

    Console.WriteLine(underlyingException.Message);

    Console.WriteLine(underlyingException.StackTrace);

    }

    System.Windows.Forms.MessageBox.Show(e.ToString());

    }

    }

    private static void EncryptFile(Stream outputStream, string fileName, PgpPublicKey encKey, bool armor, bool withIntegrityCheck)
    {

    if (armor)
    {

    outputStream = new ArmoredOutputStream(outputStream);

    }

    try
    {

    MemoryStream bOut = new MemoryStream();

    PgpCompressedDataGenerator comData = new PgpCompressedDataGenerator(

    CompressionAlgorithmTag.Zip);

    PgpUtilities.WriteFileToLiteralData(

    comData.Open(bOut),

    PgpLiteralData.Binary,

    new FileInfo(fileName));

    comData.Close();

    PgpEncryptedDataGenerator cPk = new PgpEncryptedDataGenerator(

    SymmetricKeyAlgorithmTag.Cast5, withIntegrityCheck, new SecureRandom());

    cPk.AddMethod(encKey);

    byte[] bytes = bOut.ToArray();

    Stream cOut = cPk.Open(outputStream, bytes.Length);

    cOut.Write(bytes, 0, bytes.Length);

    cOut.Close();

    if (armor)
    {

    outputStream.Close();

    }

    }

    catch (PgpException e)
    {

    Console.WriteLine(e);

    Exception underlyingException = e.InnerException;

    if (underlyingException != null)
    {

    Console.WriteLine(underlyingException.Message);

    Console.WriteLine(underlyingException.StackTrace);

    }

    }

    }

    public static void Encrypt(string filePath, string publicKeyFile, string OutputFilePath)
    {

    Stream keyIn, fos;

    keyIn = File.OpenRead(publicKeyFile);

    fos = File.Create(OutputFilePath);

    EncryptFile(fos, filePath, ReadPublicKey(keyIn), true, true);

    keyIn.Close();

    fos.Close();

    }

    public static void Decrypt(string filePath, string privateKeyFile, string passPhrase, string pathToSaveFile)
    {

    Stream fin = File.OpenRead(filePath);

    Stream keyIn = File.OpenRead(privateKeyFile);

    DecryptFile(fin, keyIn, passPhrase.ToCharArray(), pathToSaveFile);

    fin.Close();

    keyIn.Close();

    }

    public static void GenerateKey(string username, string password, string keyStoreUrl)
    {

    IAsymmetricCipherKeyPairGenerator kpg = GeneratorUtilities.GetKeyPairGenerator("RSA");

    // new RsaKeyPairGenerator();

    kpg.Init(new RsaKeyGenerationParameters(BigInteger.ValueOf(0×13), new SecureRandom(), 1024, 8));

    AsymmetricCipherKeyPair kp = kpg.GenerateKeyPair();

    FileStream out1 = new FileInfo(string.Format("{0}_PrivateKey.txt", keyStoreUrl)).OpenWrite();
    FileStream out2 = new FileInfo(string.Format("{0}_PublicKey.txt", keyStoreUrl)).OpenWrite();

    ExportKeyPair(out1, out2, kp.Public, kp.Private, PublicKeyAlgorithmTag.RsaGeneral, SymmetricKeyAlgorithmTag.Cast5, username, password.ToCharArray(), true);

    out1.Close();
    out2.Close();

    /*

    IAsymmetricCipherKeyPairGenerator dsaKpg = GeneratorUtilities.GetKeyPairGenerator("DSA");
    DsaParametersGenerator pGen = new DsaParametersGenerator();
    pGen.Init(1024, 80, new SecureRandom());
    DsaParameters dsaParams = pGen.GenerateParameters();
    DsaKeyGenerationParameters kgp = new DsaKeyGenerationParameters(new SecureRandom(), dsaParams);
    dsaKpg.Init(kgp);

    //
    // this takes a while as the key generator has to Generate some DSA parameters
    // before it Generates the key.
    //
    AsymmetricCipherKeyPair dsaKp = dsaKpg.GenerateKeyPair();

    IAsymmetricCipherKeyPairGenerator elgKpg = GeneratorUtilities.GetKeyPairGenerator("ELGAMAL");

    ElGamalParametersGenerator eGen = new ElGamalParametersGenerator();

    eGen.Init(1024,80,new SecureRandom());

    ElGamalParameters elParams = eGen.GenerateParameters();

    ElGamalKeyGenerationParameters elKgp = new ElGamalKeyGenerationParameters(new SecureRandom(), elParams);

    elgKpg.Init(elKgp);

    //
    // this is quicker because we are using preGenerated parameters.
    //
    AsymmetricCipherKeyPair elgKp = elgKpg.GenerateKeyPair();

    FileStream out3 = new FileInfo(string.Format("{0}_PrivateKey_ELGMAL.txt", keyStoreUrl)).OpenWrite();
    FileStream out4 = new FileInfo(string.Format("{0}_PublicKey_ELGMAL.txt", keyStoreUrl)).OpenWrite();

    ExportKeyPair(out3, out4, dsaKp, elgKp, username, password.ToCharArray(), true);

    out3.Close();
    out4.Close();

    */
    }

    private static void ExportKeyPair(
    Stream secretOut,
    Stream publicOut,
    AsymmetricKeyParameter publicKey,
    AsymmetricKeyParameter privateKey,
    PublicKeyAlgorithmTag PublicKeyAlgorithmTag,
    SymmetricKeyAlgorithmTag SymmetricKeyAlgorithmTag,
    string identity,
    char[] passPhrase,
    bool armor)
    {
    if (armor)
    {
    secretOut = new ArmoredOutputStream(secretOut);
    }

    PgpSecretKey secretKey = new PgpSecretKey(
    PgpSignature.DefaultCertification,
    PublicKeyAlgorithmTag,
    publicKey,
    privateKey,
    DateTime.Now,
    identity,
    SymmetricKeyAlgorithmTag,
    passPhrase,
    null,
    null,
    new SecureRandom()
    // ,"BC"
    );

    secretKey.Encode(secretOut);

    secretOut.Close();

    if (armor)
    {
    publicOut = new ArmoredOutputStream(publicOut);
    }

    PgpPublicKey key = secretKey.PublicKey;

    key.Encode(publicOut);

    publicOut.Close();
    }

    public void SignAndEncryptFile(string actualFileName, string embeddedFileName,
    Stream keyIn, long keyId,string OutputFileName ,
    char[] password, bool armor, bool withIntegrityCheck, PgpPublicKey encKey)
    {
    const int BUFFER_SIZE = 1 < < 16; // should always be power of 2

    Stream outputStream = File.Open(OutputFileName, FileMode.Create);

    if (armor)
    outputStream = new ArmoredOutputStream(outputStream);

    // Init encrypted data generator
    PgpEncryptedDataGenerator encryptedDataGenerator =
    new PgpEncryptedDataGenerator(SymmetricKeyAlgorithmTag.Cast5, withIntegrityCheck, new SecureRandom());
    encryptedDataGenerator.AddMethod(encKey);
    Stream encryptedOut = encryptedDataGenerator.Open(outputStream, new byte[BUFFER_SIZE]);

    // Init compression
    PgpCompressedDataGenerator compressedDataGenerator = new PgpCompressedDataGenerator(CompressionAlgorithmTag.Zip);
    Stream compressedOut = compressedDataGenerator.Open(encryptedOut);

    // Init signature
    PgpSecretKeyRingBundle pgpSecBundle = new PgpSecretKeyRingBundle(PgpUtilities.GetDecoderStream(keyIn));

    PgpSecretKey pgpSecKey = pgpSecBundle.GetSecretKey(keyId);

    if (pgpSecKey == null)
    throw new ArgumentException(keyId.ToString("X") + " could not be found in specified key ring bundle.", "keyId");
    PgpPrivateKey pgpPrivKey = pgpSecKey.ExtractPrivateKey(password);

    PgpSignatureGenerator signatureGenerator = new PgpSignatureGenerator(pgpSecKey.PublicKey.Algorithm, HashAlgorithmTag.Sha1);

    signatureGenerator.InitSign(PgpSignature.BinaryDocument, pgpPrivKey);

    foreach (string userId in pgpSecKey.PublicKey.GetUserIds())
    {
    PgpSignatureSubpacketGenerator spGen = new PgpSignatureSubpacketGenerator();
    spGen.SetSignerUserId(false, userId);
    signatureGenerator.SetHashedSubpackets(spGen.Generate());
    // Just the first one!
    break;
    }

    signatureGenerator.GenerateOnePassVersion(false).Encode(compressedOut);

    // Create the Literal Data generator output stream

    PgpLiteralDataGenerator literalDataGenerator = new PgpLiteralDataGenerator();

    FileInfo embeddedFile = new FileInfo(embeddedFileName);

    FileInfo actualFile = new FileInfo(actualFileName);

    // TODO: Use lastwritetime from source file
    Stream literalOut = literalDataGenerator.Open(compressedOut, PgpLiteralData.Binary,
    embeddedFile.Name, actualFile.LastWriteTime, new byte[BUFFER_SIZE]);

    // Open the input file
    FileStream inputStream = actualFile.OpenRead();

    byte[] buf = new byte[BUFFER_SIZE];
    int len;
    while ((len = inputStream.Read(buf, 0, buf.Length)) > 0)
    {
    literalOut.Write(buf, 0, len);
    signatureGenerator.Update(buf, 0, len);
    }

    literalOut.Close();
    literalDataGenerator.Close();
    signatureGenerator.Generate().Encode(compressedOut);
    compressedOut.Close();
    compressedDataGenerator.Close();
    encryptedOut.Close();
    encryptedDataGenerator.Close();
    inputStream.Close();

    if (armor)
    outputStream.Close();
    }

    private static void ExportKeyPair(
    Stream secretOut,
    Stream publicOut,
    AsymmetricCipherKeyPair dsaKp,
    AsymmetricCipherKeyPair elgKp,
    string identity,
    char[] passPhrase,
    bool armor)
    {
    if (armor)
    {
    secretOut = new ArmoredOutputStream(secretOut);
    }

    PgpKeyPair dsaKeyPair = new PgpKeyPair(PublicKeyAlgorithmTag.Dsa, dsaKp, DateTime.UtcNow);

    PgpKeyPair elgKeyPair = new PgpKeyPair(PublicKeyAlgorithmTag.ElGamalEncrypt, elgKp, DateTime.UtcNow);

    PgpKeyRingGenerator keyRingGen = new PgpKeyRingGenerator(PgpSignature.PositiveCertification, dsaKeyPair,
    identity, SymmetricKeyAlgorithmTag.Aes256, passPhrase, true, null, null, new SecureRandom());

    keyRingGen.AddSubKey(elgKeyPair);

    keyRingGen.GenerateSecretKeyRing().Encode(secretOut);

    if (armor)
    {
    secretOut.Close();
    publicOut = new ArmoredOutputStream(publicOut);
    }

    keyRingGen.GeneratePublicKeyRing().Encode(publicOut);

    if (armor)
    {
    publicOut.Close();
    }
    }

    }

    להגיב
  21. Mike7 במאי 2010 ב 20:56

    An Eg: public key created with this code…

    —–BEGIN PGP PUBLIC KEY BLOCK—–
    Version: BCPG C# v1.6.1.0

    mIsES+Fg5wEEAJrkeNnXhQtG9ksqP6vCxxCHrdl32ud9mZUo3l82wr6hzHFXytxN
    Zro/eSchYKtrWWpnWic20zy0vVdG4r2lqC7tc+OMdRHftqNi/97T/D0geU4G0zjV
    PegwzjwUEflYZmzA5CdMIegelmKXHvN4mBzKhRrIz25pYZZUtvo+oATZAAUTtAhz
    cGFyZWtoM4icBBABAgAGBQJL4VLXAAoJEEdeXuFsWFgEsicD/1M/CaK/Gh+zv/Lj
    GauXRf5G6KyHSX4oLjn8xAZTVtPYxgJHmN5/JpQgcwqAfxtfgMehsEXG2RNehOCl
    mabkk0caJJCg5epbuKoc6SnqrquTBX0Fi9+xuMyx8AFtXuXb0IygwOPWoHeT0IkM
    /gy6isQjlDHfTHTsybb67BxgLb4C
    =ZyOZ
    —–END PGP PUBLIC KEY BLOCK—–

    להגיב
  22. imran3 באוקטובר 2010 ב 15:56

    Hello kim,

    My client has a .net application that will create a .txt file and every month they send it to a bank, now my client wants to send the file in encrypted format using "PGP".
    My concerns are as follows:

    1. Does my client needs a license FOR PGP (SDK)? OR ( a free dll can be used )

    2. PGP SDK does not support .NET, so is it possible for an average programmer to write a wrapper class(c#) for SDK ?

    3. I am new to PGP, so please let me know how to achieve it in steps.

    Thanks.

    להגיב
  23. Donnie28 בדצמבר 2010 ב 18:11

    The link provided shows some different examples of how GoAnywhere Director makes PGP, FTP, SFTP and more much easier.

    להגיב
  24. Ian Lee28 בינואר 2011 ב 7:07

    Thanks for the PGP classes! However, I'm having a problem… I can encrypt & sign my file fine but when the customer decrypts the file it is not exactly as it was when I encrypted. Obviously, this is a huge problem. Everything works fine if I use Kleopatra, so I believe the problem must exist in your code somewhere. Email me at ian at houseoflees dot net if I can send you the files to inspect.

    Thanks!

    Ian

    להגיב
  25. jaime baltodano22 במרץ 2011 ב 19:12

    I got this error
    Checksum mismatch at 0 of 20. and i cannot understand the cause. my code is in C#.net 2008

    להגיב
  26. psychoref12 באפריל 2011 ב 13:48

    I want the space! How much does it cost?

    להגיב
  27. praveen21 במאי 2011 ב 11:54

    hi jaime , can you please share your code in c#..my requirement is to encrypt/decrypt a text file using c# with PGP bouncy castle.

    להגיב
  28. TheoSuccess18 ביוני 2011 ב 13:30

    It is instructive. But I would not have been able to.

    להגיב
  29. Swordconjuror26 ביוני 2011 ב 0:53

    Very simple in words but in reality, many discrepancies, not so peachy!

    להגיב
  30. immirmGem5 בפברואר 2012 ב 5:36

    A true belief in individual liberty and peace and a voting record to match it.

    להגיב
  31. Sam6 באפריל 2012 ב 18:03

    Thank you, so much! This is exactly what we needed.

    להגיב
  32. Gautham3 ביולי 2012 ב 15:36

    What are public key file name and private key file name over here? How do we provide these parameters?

    להגיב
  33. Aidas25 ביולי 2012 ב 14:49

    Hi, who have tried MIKE's suggested EncryptDecrypt class? Encryption works fine, but Decrypt method throws an exception:

    Org.BouncyCastle.Bcpg.OpenPgp.PgpException: Exception creating cipher —> Org.BouncyCastle.Security.SecurityUtilityException: Cipher IDEA/CFB/NOPADDING not recognised.
    at Org.BouncyCastle.Security.CipherUtilities.GetCipher(String algorithm)
    at Org.BouncyCastle.Bcpg.OpenPgp.PgpSecretKey.ExtractKeyData(Char[] passPhrase)
    — End of inner exception stack trace —
    at Org.BouncyCastle.Bcpg.OpenPgp.PgpSecretKey.ExtractPrivateKey(Char[] passPhrase)
    at PGPEncryption.PGPEncryptDecrypt.FindSecretKey(PgpSecretKeyRingBundle pgpSec, Int64 keyId, Char[] pass) in D:\SVN\Tools\PGPEncryption\PGPEncryption\PGPEncryptDecrypt.cs:line 71
    at PGPEncryption.PGPEncryptDecrypt.DecryptFile(Stream inputStream, Stream keyIn, Char[] passwd, String pathToSaveFile) in D:\SVN\Tools\PGPEncryption\PGPEncryption\PGPEncryptDecrypt.cs:line 108
    Cipher IDEA/CFB/NOPADDING not recognised.
    at Org.BouncyCastle.Security.CipherUtilities.GetCipher(String algorithm)
    at Org.BouncyCastle.Bcpg.OpenPgp.PgpSecretKey.ExtractKeyData(Char[] passPhrase)

    Here is the TEST function of mine. Am I missing something?

    [Test]
    public void Should_Decrypt()
    {
    string privateKeyPath = @"D:\some_key.asc";
    string passPhrase = "some@pass";
    string EncryptedFileName = @"D:\original.pgp";
    string DecryptedFileName = @"D:\decrypted.xml";

    PGPEncryptDecrypt.Decrypt(EncryptedFileName, privateKeyPath, passPhrase, DecryptedFileName);
    }

    להגיב
  34. qfvrwjvp@gmail.com7 בדצמבר 2012 ב 7:12

    I know this comes at a busy time,Windows Server 2003 Key, with you most likely distracted by the European situation.

    להגיב
  35. pwmcxr@gmail.com13 בדצמבר 2012 ב 13:39

    they did in Cast Lead.Posted by: ToivoS | Nov 15, 2012 4:36:33 PM | 20@ Colm, re Iron Dome.

    להגיב
  36. cerzevfvvjd@gmail.com22 בדצמבר 2012 ב 14:32

    destroyed the owner of the elephant, so too, this prophecy will endure till the Day of Resurrection. Whenever any owners of the elephant arise, in order to destroy them,

    להגיב
  37. Rudd19 במרץ 2013 ב 5:10

    Fantastic beat ! I would like to apprentice whilst you amend your site, how can i subscribe for a weblog web
    site? The account helped me a appropriate deal.
    I were tiny bit acquainted of this your broadcast
    provided shiny transparent concept

    להגיב
  38. Jin7n10 באפריל 2013 ב 20:29

    With besseren Zeiten darf es dann ebenso gern wieder G盲nseleber und Champagner geben, aber jetzt sind halt erst mal Bier sowie Bockwurst angesagt. Ganz and so einfach ist es jedoch nicht. Denn es will immer mehr thus scheinen, wie stecke der Luxus nicht nur in der Flaute, sondern throughout einer regelrechten Legitimationskrise.
    Seit The year 2005 sind gerade douleur 3.384 St眉ck des D 6 verkauft worden, nicht inside Frankreich, insgesamt. Renault hatte seine barocke Fehlentwicklung Vel Satis schon 09 aufgegeben, Peugeot seinen 607 ein Jahr sp盲ter. Damit crown expire State, pass on auf der Welt f眉hrend ist durch Luxusartikeln von Herm猫s bis Lv, expire prachtvolle Bauwerke ihr Eigen nennt sowie durch Spitzenk眉che cease to live Gaumen verw枚hnt, with der automobilen Oberklasse nichts mehr zu bieten.
    Expire Arbeitslosenquote fiel auf Six,Six von 8,Several Prozent — vor allem weil immer mehr Menschen depart this life Jobsuche aufgeben. Depart this life Line liegt damit noch deutlich 眉ber dem Schnitt der vergangenen 50 Jahre von sechs Prozent. Nun k枚nnte sich r盲chen, dass sich Demokraten und Republikaner internet marketing erbittert gef眉hrten Haushaltsstreit instant messaging Kongress nicht einigen konnten.

    להגיב
  39. Meo812 באפריל 2013 ב 18:51

    For me personally, it had been on / off the actual motorbike the whole time. When investing in to your 4 way stop with Farlow Hole Trail (and that is wide open this specific signed being finished out of this course) the actual journey factors a person lower mountain for a [url=http://www.apsi.com.mx/insanityworkout.html]insanity workout[/url]
    while, but requires back slope. Immediately after Farlow Space your trail is definitely many more rideable compared to you recently developed.
    15 what to know to get now

    להגיב
  40. Rolly4s17 באפריל 2013 ב 4:28

    15 wonderful werewolf shift views remarks
    Except if you've well-balanced your daily diet beautifully with the exercise technique, there may be some sort of [url=http://insanityworkoutdvds.tumblr.com/]insanity workout[/url]
    place in there for more vitamins and minerals along with vitamin antioxidants. A high-quality multi-vitamin can certainly add some of [url=http://insanityworkoutdvds.tumblr.com/]insanity workout[/url]
    these nutritionary spaces. To avoid trouble for the muscle flesh the result of 'free radicals' (reactive elements that will adversely destabilize additional substances), you might want to think about using supplements that includes Supplements A, Age, plus D; selenium along with glutamine can also help those people muscle groups temporarily injured through your strength training.

    להגיב
  41. Myi6s17 באפריל 2013 ב 7:38

    There is absolutely no these matter when failure simply abandoning. While E\dison bad On the lookout for,999 times in his tries to produce the electric powered light-bulb your dog didn't surrender. When quized with regards to his or her failures he stated, "I didn't been unsuccessful, I've got just discovered 9,999 strategies don't work!Inches.
    Quantity In search of The actual [url=http://insanityworkoutdvds.tumblr.com/]insanity workout DVD[/url]
    Achy Breaky Poor Mistakey There are some movements which might be that should be left un-revived. Of which undoubtedly the way it is while using Painful Breaky, a new [url=http://insanityworkoutdvds.tumblr.com/]insanity DVD[/url]
    complicated crotch-thrusting set boogie empowered from the Billy Lewis Cyrus song. Very similar to bathroom hooch along with internet dating the sis, this is just one redneck craze you need to keep away from [url=http://insanityworkoutdvds.tumblr.com/]insanity workout[/url]
    – except undertaking awful party movements outings a person's lead to.

    להגיב
  42. Jin3d17 באפריל 2013 ב 20:53

    Amongst [url=http://insanityworkoutdvds.tumblr.com/]insanity DVD[/url]
    the the reason why individuals do not think clearly about this issue that they seemingly don't even think regarding it in the least. If you think that Jimmy Grehan paid out 171m for your Two.Only two acre web site with [url=http://insanityworkoutdvds.tumblr.com/]insanity workout[/url]
    the previous veterinary clinic clinic throughout Dublin 4, you very well may commence to understand that all of the half-acre personal back yards all over Ballsbridge are creating the more costly carnations on earth. Those people made in Tiffany's are usually sugar-paste and salt-crystal by comparison.
    12 notable exploitation motion pictures

    להגיב
  43. Helton21 באפריל 2013 ב 5:00

    With havin so much content and articles do you ever run into any issues of plagorism or
    copyright violation? My website has a lot of
    completely unique content I've either authored myself or outsourced but it seems a lot of it is popping it up all over the internet without my permission. Do you know any ways to help stop content from being stolen? I'd certainly appreciate it.

    להגיב
  44. Quintero21 באפריל 2013 ב 11:34

    Right now it appears like WordPress is the top blogging platform
    available right now. (from what I've read) Is that what you are using on your blog?

    להגיב
  45. chatliveusa@gmail.com11 ביוני 2013 ב 0:08

    Lancel, wearing a black suit and striped tie, took to the witness box and answered questions from his barrister Andrew Menary QC on Thursday.

    להגיב
  46. pangearve20 ביוני 2013 ב 1:48

    nis says: Americans are so freakin' [url=http://athamedioneaorcini.com/]cheap soccer jerseys for kids[/url] stupid! To worry about if someone knows how to honor the flag yet say nothing about the idiot who ruined this country amp ignores our veterans. Chickenhawk W' salutes the flag, goes to church amp screws regular Americans everyday. We should vote on their ideas, plans amp who they will appoint to positions. This is right wing bullsh*t to keep our minds off the real issues. UH OH, here come the Chickenhawk O'Reilly Rush patriots to tell us about the liberal media. Now there is a real example of stupid! Chickenhawk liars! March 18, 2008 at 3:39 pm 252 jr says: It is what it is! It makes me scared why Mr. Obama would want to be president of a country he does not respect [url=http://athamedioneaorcini.com/]cheap soccer jerseys[/url] and is clearly racial and a complete muslim 8230 . hidden agenda, maybe! March 21, 2008 at 12:22 pm 253 Wild Bill says: As a Boy Scout and a soldier in the U. S. Army I was always taught that the proper etiquette or protocol not law was to place your hand over your heart while saying the Pledge of Allegiance and stand at attention looking at the flag while the National Anthem was played. If in uniform, you should salute, but THERE IS NOTHING SAYING ANYONE HAS TO PUT THEIR HAND OVER THEIR HEART DURING THE NATIONAL ANTHEM! You just have to stand quietly and respectfully, as Senator Obama was doing. Those who were placing their hands over their hearts were confused, as many Americans seem to be. Oh yeah, you also are not required to stand when someone sings the grammatically incorrect I'm Proud To Be an American. March 28, 2008 at 12:34 am 254 rmr says: Not respecting nor upholding the traditions of a nation one wants to be president of should be a red flag to every citizen who can add one plus one. How naive have we become? This can only be a drop in the bucket of surprising events awaiting just beyond the horizon if this is the type leader we place in the top office of our nation. Life as we know it in this great land will be over. March 28, 2008 at 12:40 am 255 rrk

    להגיב
  47. meteProff23 ביוני 2013 ב 9:39

    sdakdjalkjsdkljaskdjklajsdkljalskdjaklsjdlkajsdklajdklssdasd 31338047

    להגיב
  48. tusiletrieflY1 ביולי 2013 ב 14:30

    Hidden Remedies For fashion A Number Of Thoughts On The Forthcoming Future Of the fashion All The Contemporary Points Over fashion They Didn't Think I Could Become A fashion Specialist…Now I Am ;-) An 6-Min Policy For the fashion The Horrible Inescapable Truth Regarding Your Lovely fashion Desire An Impartial Peek At fashion The History Pointing To fashion This Is Basically The fashion Truths Your Mother And Father Doesn't Want One To Know About
    Just Who Wants To End Up Being A Comprehensive fashion Pro? Types Of fashion I Definitely Need The Best Recommendations For Hassle Free fashion Understanding 2 fashion Guidelines You Must Keep In Mind A Fella Who Just Sold A fashion Report For A Million Everything You Havent Heard Of fashion May Very Well Amaze You By Far The Most Fun You Could Have With Out Skipping fashion Those Things fashion Pros Can Teach You So, Who Would Seriously Like To Become An Thorough fashion Whiz?
    ——————————————————————————————————–

    להגיב
  49. tusiletrieflY2 ביולי 2013 ב 3:13

    What Everybody Ought To Know Concerning fashion Frustrated With fashion ?? Then Read This !! Planets Leading 6 Most Valuable fashion Techniques Once Man And fashion Clash Here's A Approach That's Even Helping fashion-Industry Experts Growing The Trick Of Turning Into An Productive fashion Pro Getting Traffic Strategy That Is Actually Enabling fashion-Specialists Grow Three fashion Tips It Is Best To Comply With fashion Site Owners Are Now Being Buzzed Within The Usa, Not Only European Countries
    Anything People Informed You About fashion Is certainly Dead Wrong Nine fashion's That Will Hard rock This Season fashion Bloggers Are Being Buzzed Within The Usa, Not Just Western World The Three Most Asked Questions About fashion fashion : Develop Into An Qualified Professional In 6 Easy Phases Striking Knowledge About fashion Our 3-Minute Policy On fashion 25 fashion's That's Going To Rock Next Year fashion Fabricates You've Been Assured About
    ——————————————————————————————————–

    להגיב
  50. tusiletrieflY2 ביולי 2013 ב 5:22

    The Top 4 Most Asked Questions Regarding fashion fashion Unearths Its Own Self, Prepares An Arctic Voyage A Husband Who Ended Up Selling His fashion Story For One Million A Couple Of Ways To Play With fashion Plus Make Profit From It! Discover The Scoop On fashion Before You Are Too Late fashion Lies You've Been Compelled Around So, Who Desires To Become A Absolute fashion Expert? Handful Of Thoughts Around The Near Future Of fashion So, Who Desires To Become A Full fashion Magician?
    Achieve The Insiders Info Around fashion Before You Are Too Late All Hard Genuine Truth About fashion Mysterious Details About fashion Posted By The Masters Rapid Solutions To fashion In Step-By-Step Details What On Earth Is Happening With fashion A 6-Hour Procedure On fashion A 6-Sec Trick For the fashion The Background Regarding fashion Things fashion Pros Should Educate You On
    ——————————————————————————————————–

    להגיב
  51. SuperUser5 באוגוסט 2013 ב 2:21

    Hello gyus..

    i have a question..

    PgpEncryptedDataGenerator encryptedDataGenerator;
    encryptedDataGenerator =
    new PgpEncryptedDataGenerator(SymmetricKeyAlgorithmTag.TripleDes,
    new SecureRandom());

    we encrypt using symmetric algorithm but with the public key of the assymetric algorithm.I suppose that this is not the real case.. we need a public/private pair for the encryption of the real symmetric key.. Am i correct?

    להגיב
  52. roaceqbp@gmail.com13 באוגוסט 2013 ב 8:51

    The conversation continues but the conversation topic seem boring to her. The company, which sells nearly [pounds sterling]50 million worth of shoesEach one dvd has an array of department points, wherein a hypnotherapist can select which the circumstances is going to go forward to suit one's person's solution. cheap christian louboutin,http://www.eefni.org.uk/news/christian-louboutin.html/ christian louboutin outlet,http://www.eefni.org.uk/news/christian-louboutin.html/ christian louboutin outlet http://www.eefni.org.uk/news/christian-louboutin.html/

    להגיב
  53. qbictcckuph@gmail.com13 באוגוסט 2013 ב 9:04

    And today, Alexander Wang Balenciaga was confirmed as the new creative director, he is able to make greater achievements in Balenciaga, we'll see.Earlier this month, Balenciaga outgoing parted ways with its creative director Nicolas Ghesquière, ending fifteen years of cooperation between the messages. The rumors sparked on this avant-garde brand Balenciaga who will take over the reins of speculation. There are also industry sources tone that will succeed alexander wang bags Balenciaga's creative director
    alexander wang bag http://alexanderwangstore.webs.com

    להגיב
  54. dkubojz@outlook.com14 באוגוסט 2013 ב 2:36

    [url=http://www.gq910h4nn3z6yyg6p2e8l77h594ngd08s.com/]xulblzwr[/url]
    xulblzwr http://www.gq910h4nn3z6yyg6p2e8l77h594ngd08s.com/
    xulblzwr

    להגיב
  55. MacMillan17 באוגוסט 2013 ב 18:34

    MCM shopping dispatch- 2013 do up and summer a rugged advertising
    MCM, all products are made ??using the finest materials, clockwork, purses using at most the most advanced materials, leather is soft, durable, waterproof and can confront UV rays, MCM brand name was founded in 1976 in Munich, Germany, is the builder of Hollywood superstar – Michael Cromer, the letters "MCM" clutch on Craze, Start, Munich. MCM manufacturer consequence lines to clothing, duds and leather-based. MCM chief started to mount leather goods, in the 1980s, the variety's heyday, MCM theatre arts, including jewelery, watches, perfumes, clothing, bags and copied leather goods, etc., more than five hundred models of the product. It is create, luxurious and down-to-earth products are more readily popular.

    להגיב
  56. kjyscevy@gmail.com29 באוגוסט 2013 ב 21:01

    Hello! I know this is kinda off topic but I'd figured I'd ask. Would you be interested in exchanging links or maybe guest authoring a blog article or vice-versa? My site covers a lot of the same topics as yours and I feel we could greatly benefit from each other. If you're interested feel free to shoot me an e-mail. I look forward to hearing from you! Excellent blog by the way! ニコン 一眼レフ http://osdi.org/images/camera07.html

    להגיב
  57. Agitleenronge26 בספטמבר 2013 ב 22:35

    cheap 49ers jersey

    However Zumba, In contrast to dance classes like hiphop and breakdancing, Which no less get a smattering of dudes, Seems highly unpopular with men. Now you ask: So why, So why? don cheap 49ers jersey men Zumba? I set out to achieve the answer. Actually, There are several reasons. You'll find varieties of the Dufferin house cue. The Q2M50 model comes with a higher four point butt design and a matte finish, While the Q2M100 has a glossy finish. The HiRun model along with a 12.5 mm Lepro as well as fiber ferrules, And the HiRun Ebony has a butt secition made in ebony. As the Olympic event was always a contest, sweepstakes among amateur teams, Sir Thomas Lipton decided to establish the Sir Thomas Lipton Trophy Championship in Turin in the past year 1909. This tournament is often taken into consideration the first world cup, And brought in professionalism and reliability into the match de football(Rugby game) By featuring qualified skilled trained clubs from Germany, Italy and europe. The first edition of this event was topped by West Auckland, Which was a novice team from England's north east.

    להגיב
  58. DenGrasefresy2 בנובמבר 2013 ב 11:00

    This is totally standard, and isn't performing anything poor on your gadgets or even stores or even everything. [url=http://75centshop.com]louis vuitton outlet[/url] Even so, such as the grilling with charcoal bbq grill you are going to have to have a backyard of some kind to be able to operate this.
    Nevertheless Zellers has not been fully erased. You'll find about three Zellers retailers still wide open within North america, such as one inch Toronto, at the Kipling Queensway Local mall. [url=http://www.historicartdistrict.com]cheap true religion[/url] Really does Insomnia Affect Sporting activities Overall performance?
    For example the cheapest sort of barbecue grill may be the smokey barbecue grilling bbq grill. This is the quintessential kind of bbq grill that you will observe inside videos as well as in shows. It is usually put outside the house and that's generally in which the barbecuing happens. The idea cooks the meals a good deal more slowly but it's very sturdy and also long-lasting. [url=http://www.plasticpistol.com]coach outlet online[/url] That Markets Silicone Mulch? Silicone thick mulch is becoming well-accepted amid backyard gardeners. Who offers rubber compost? The majority of common stores, gardening provide shops, and home advancement stores just like Home Depot or even Lowes usually sell it off. With respect to the particular time it can be difficult to find in your area. On the internet suppliers may also be an excellent option when looking for this kind of merchandise. There are generally discounts and also special deals that consumers can find whenever browsing online retailers. Both are experts in offering reused plastic compost regarding landscape designs and sometimes permit people to obtain freebies of the products.

    להגיב