From: rvsi...@live.com
To: dev-crypto-csharp-requ...@bouncycastle.org
Subject: Help Exception creating cipher
Date: Wed, 10 Oct 2012 18:35:33 +0300




Hello all.
There are times I'm trying to decrypt a file with pgp library Bouncy Castle, 
but after using several examples of internet'm still with the same error.
Exception creating cipher
Inner Exception - {"Cipher IDEA/CFB/NOPADDING not recognised."}
I tried these forms:
#1private static PgpPrivateKey FindSecretKey(PgpSecretKeyRingBundle pgpSec, 
long keyId, char[] pass)        {            PgpSecretKey pgpSecKey = 
pgpSec.GetSecretKey(keyId);
            if (pgpSecKey == null)                return null;
            return pgpSecKey.ExtractPrivateKey(pass);        }
#2private PgpPrivateKey GetPrivateKey(string privateKeyPath, string pass)       
 {
            using (Stream keyIn = File.OpenRead(privateKeyPath))            
using (Stream inputStream = PgpUtilities.GetDecoderStream(keyIn))            {  
              PgpSecretKeyRingBundle secretKeyRingBundle = new 
PgpSecretKeyRingBundle(inputStream);
                PgpSecretKey key = null;                foreach 
(PgpSecretKeyRing kRing in secretKeyRingBundle.GetKeyRings())                {  
                  foreach (PgpSecretKey secretKey in kRing.GetSecretKeys())     
               {                        PgpPrivateKey privKey = 
secretKey.ExtractPrivateKey(pass.ToArray());

                        return privKeyF = privKey;                       

                    }                }            }
            return null;        }


Does anyone know what is happening?
They would have to send me other examples?
Thank you.
Sorry for my bad English.
Atenciosamente

Rodrigo Vieira da Silva
rvsi...@live.com
rvsi...@cloudwar.com.br
111...@li.facens.br
Tel.: (15) 3213-2014
Cel.: (15) 9757-0068
                                                                                
  

Reply via email to