程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 編程語言 >> .NET網頁編程 >> C# >> C#入門知識 >> BouncyCastle.Crypto的RSA算法調用源碼

BouncyCastle.Crypto的RSA算法調用源碼

編輯:C#入門知識

C#的BouncyCastle.Crypto,RSA算法調用的源碼,正在研究這個,分享給大家。

官網:http://www.bouncycastle.org/csharp/

  
  
            
                     BigInteger mod =  BigInteger(,           BigInteger pubExp =  BigInteger(,           BigInteger privExp =  BigInteger(,           BigInteger p =  BigInteger(,           BigInteger q =  BigInteger(,           BigInteger pExp =  BigInteger(,           BigInteger qExp =  BigInteger(,           BigInteger crtCoef =  BigInteger(,  
           input =  
         
                             edgeInput =  
          [] oversizedSig = Hex.Decode(          [] dudBlock = Hex.Decode(          [] truncatedDataBlock = Hex.Decode(          [] incorrectPadding = Hex.Decode(          [] missingDataBlock = Hex.Decode( 
                          {    
                        IAsymmetricBlockCipher eng =  
             eng.Init( 
             [] data =  
             
                  data = eng.ProcessBlock(oversizedSig,                                 Fail( +  
             eng =  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,  
                 Fail(                                 (!e.Message.Equals(                      Fail( +   
 
             
             Pkcs1Encoding.StrictLengthEnabled =  
             eng =  Pkcs1Encoding( 
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
             Pkcs1Encoding.StrictLengthEnabled =   
                        checkForPkcs1Exception(pubParameters, privParameters, truncatedDataBlock,   
                        checkForPkcs1Exception(pubParameters, privParameters, dudBlock,   
                        checkForPkcs1Exception(pubParameters, privParameters, incorrectPadding,   
                        checkForPkcs1Exception(pubParameters, privParameters, missingDataBlock,   
           checkForPkcs1Exception(RsaKeyParameters pubParameters, RsaKeyParameters privParameters, [] inputData,               IAsymmetricBlockCipher eng =  
             eng.Init( 
             [] data =  
             
                  data = eng.ProcessBlock(inputData,                                 Fail( +  
             eng =  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,  
                 Fail(                                 (!                      Fail( +    
                        
                                       IAsymmetricBlockCipher eng =  OaepEncoding(             [] data = 
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
              (!                  Fail(   
         
                    
           doTestBadSig()
              
             ISigner sig = SignerUtilities.GetSigner(                                        
             
             RsaKeyPairGenerator fact =  
             
             RsaKeyGenerationParameters factParams =                  
                 BigInteger.ValueOf(),  SecureRandom(), ,   
                          
                          
             AsymmetricCipherKeyPair keyPair = 
             AsymmetricKeyParameter priv =             AsymmetricKeyParameter pub = 
              
 
 
 
 
             
             IDigest sha1 = DigestUtilities.GetDigest( 
                          
             IAsymmetricBlockCipher signer =  Pkcs1Encoding( 
             
             signer.Init( 
                          
             [] block =   
             
             sha1.Update( 
             
             [] sigHeader = Hex.Decode(             
             Array.Copy(sigHeader, , block,  
             
  
                          
             Array.Copy(sigHeader,                  sigHeader.Length + 
             
             [] sigBytes = signer.ProcessBlock(block,  
             
             ISigner verifier = SignerUtilities.GetSigner( 
             
             verifier.Init( 
             
             verifier.Update( 
             
                               
                 Fail(   
                        IAsymmetricBlockCipher eng =  Pkcs1Encoding( 
             eng.Init( 
              (eng.GetOutputBlockSize() !=                  Fail(  
             [] zero =  [             [] data =  
             
                  data = eng.ProcessBlock(zero,                                 Fail( +  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
              (!                  Fail(   
                         RsaKeyParameters pubParameters =  RsaKeyParameters(             RsaKeyParameters privParameters =              [] data = 
             
                                       IAsymmetricBlockCipher eng =  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
              (!                  Fail(  
             data = 
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
              (!                  Fail(  
             
                                       eng =  
             eng.Init( 
              (eng.GetOutputBlockSize() !=                  Fail(  
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
              (!                  Fail(  
             
                                       eng =  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
              (!                  Fail(  
   
             
                                       RsaKeyPairGenerator pGen =              RsaKeyGenerationParameters genParam =                  BigInteger.ValueOf(),  SecureRandom(), ,  
  
             AsymmetricCipherKeyPair pair = 
             eng =  
              (((RsaKeyParameters)pair.Public).Modulus.BitLength <                   Fail(  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
              (!                  Fail(  
             genParam =  RsaKeyGenerationParameters(BigInteger.ValueOf(),  SecureRandom(), ,  
              pair = 
             eng.Init( 
              (((RsaKeyParameters)pair.Public).Modulus.BitLength <                   Fail(  
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
             eng.Init( 
             
                  data = eng.ProcessBlock(data,                                 Fail( +  
              (!                  Fail(  
             genParam =                  BigInteger.ValueOf(),  SecureRandom(), ,   
              ( i = ; i < ; ++                  pair =                 RsaPrivateCrtKeyParameters privKey =                 BigInteger pqDiff = 
                  (pqDiff.BitLength <                       Fail(   
        
             
                   RsaEngine().ProcessBlock( [] {  }, ,                  Fail(                                
   
                                      ITest test =              ITestResult result = 
   
                         
   }

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved