The Bouncy Castle C# Cryptographic API

Contents:

  1. The Bouncy Castle Cryptographic C#® API
      1. Contents:
      2. License & Contributors:
      3. Features:
      4. How To Build.
      5. The Source:
      6. Documentation:
      7. For first time users.
      8. Notes:
        1. Release 2.4.0
        2. Release 2.3.1
        3. Release 2.3.0
        4. Release 2.2.1
        5. Release 2.2.0
        6. Release 2.1.1
        7. Release 2.1.0
        8. Release 2.0.0
        9. Release 1.9.0
        10. Release 1.8.10
        11. Release 1.8.9
        12. Release 1.8.8
        13. Release 1.8.7
        14. Release 1.8.6
        15. Release 1.8.5
        16. Release 1.8.4
        17. Release 1.8.3
        18. Release 1.8.2
        19. Release 1.8.1
        20. Release 1.8.0
        21. Release 1.7
        22. Release 1.6.1
        23. Release 1.6
        24. Release 1.5
        25. Release 1.4
        26. Release 1.3
        27. Release 1.2
        28. Release 1.1
        29. Release 1.0
        30. Tuesday Febuary 1, 2005
        31. Sunday December 12, 2004
      9. Trademarks.


License & Contributors:

See License & Contributors files.
 

Patents:

Some of the algorithms in the Bouncy Castle APIs are patented in some places. It is up to the user of the library to be aware of their own legal situation, however we have been asked to specifically mention the patents below, in the following terms, at the request of the patent holder.

The BC distribution contains implementations of EC MQV as described in RFC 5753, "Use of ECC Algorithms in CMS". In line with the conditions in:

http://www.ietf.org/ietf-ftp/IPR/certicom-ipr-rfc-5753.pdf

We state, where EC MQV has not otherwise been disabled or removed: "The use of this product or service is subject to the reasonable, non-discriminatory terms in the Intellectual Property Rights (IPR) Disclosures of Certicom Corp. at the IETF for Use of Elliptic Curve Cryptography (ECC) Algorithms in Cryptographic Message Syntax (CMS) implemented in the product or service."

 


Features:


Porting notes from the old ASN.1 library For the most part code using the old subset of ASN.1 classes should be easy to transfer, providing the following changes are made:



How To Build.

(NOTE: This build system is essentially obsolete and will be withdrawn after the 1.8 series. We have introduced MSBuild project files which will probably be a preferred option if you want to build yourself.)

The BC C# API uses NAnt (http://nant.sourceforge.net) to provide a platform independent build environment (suggested version NAnt 0.90). There is also a solution file for Visual Studio, and for MonoDevelop. The API works with .NET Framework 1.1 and above. It has been successfully built and tested with Mono versions from 1.1.13 onwards. The source code can be built for .NET Compact Framework 1.0 by setting the compilation flag NETCF_1_0, or .NET Compact Framework 2.0 by setting NETCF_2_0, or Silverlight 2 by setting SILVERLIGHT.

Using a command prompt (DOS window), cd into the 'crypto' folder of this distribution.

Use,

Output:

    The compiled API can be found in the 'api/bin/release' & 'api/bin/debug' directories.
    The compiled tests can be found in the 'test/bin' directory (by default a debug build is used for testing).


The Source:

The main source code can be found in the 'src' directory.


Documentation:

There is limited documentation available at the moment. Some of the source contains XML comments, but this is a work in progress. We welcome contributions of documentation, which often requires only formatting changes from the corresponding javadoc in the Java API.


For first time users.

 Java® heritage,

The Bouncy Castle C# API is a port of the Bouncy Castle Java APIs. Approximately %80 of the functionality in the Java build has now been ported. For the most part, the naming conventions of the .NET platform have been adopted. The C# API is constantly kept uptodate with bug fixes and new test cases from the Java build (and vice versa sometimes), thus benefitting from the large user base and real-world use the Java version has seen.

Please consider.

The Bouncy Castle C# API is a library of transformations that when combined properly will enable developers to create standard conforming cryptographic systems. In order to use this API you must have some knowledge of how to build cryptographic systems, namely what transformations to use and the when, where and why of their use. Developing good cryptographic systems takes practice and understanding.

There are many resources available online and in book shops; please use those to your advantage.


Notes:

Release 2.4.0, Monday May 27, 2024

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 2.3.1, Tuesday May 7, 2024

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 2.3.0, Monday February 5, 2024

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 2.2.1, Friday April 21, 2023

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 2.2.0, Monday April 17, 2023

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 2.1.1, Saturday February 18, 2023

This is a hotfix release to fix the missing symbols for the 2.1.0 release. We have now added an snupkg with symbols, enabled SourceLink, and made the build deterministic. There was no change to functionality.

Release 2.1.0, Saturday February 18, 2023

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 2.0.0, Tuesday November 15, 2022

With this release we have finally moved to building for modern .NET versions (directly targeted frameworks: net461, netstandard2.0, net6.0), and distributing using NuGet (package name BouncyCastle.Cryptography). We have also adopted Semantic Versioning 2.0.0 for package versioning.

There are backward compatibility breaks with this release, but they are minor and the overall process of migrating from either Release 1.9.0 (or Portable.BouncyCastle) should be smooth for most users. The legacy TLS implementation (Org.BouncyCastle.Crypto.Tls) has been removed and users should migrate to the new implementation (Org.BouncyCastle.Tls).

Dedication

This release is dedicated to Claire Novotny, who has been keeping the project alive for the past several years in the form of the Portable.BouncyCastle NuGet package.

IMPORTANT
Defects Fixed
Additional Features and Functionality
Additional Notes

Release 1.9.0, Sunday October 17, 2021

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 1.8.10, Tuesday February 16, 2021

Defects Fixed
Additional Notes

Release 1.8.9, Tuesday December 8, 2020

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 1.8.8, Monday September 21, 2020

Additional Features and Functionality
Additional Notes

Release 1.8.7, Thursday July 30, 2020

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 1.8.6, Friday February 21, 2020

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 1.8.5, Thursday January 31, 2019

Additional Features and Functionality
Additional Notes

Release 1.8.4, Saturday October 27, 2018

IMPORTANT
Defects Fixed
Additional Features and Functionality
Additional Notes

Release 1.8.3, Saturday August 11, 2018

IMPORTANT
Additional Features and Functionality
Additional Notes

Release 1.8.2, Monday April 9, 2018

Security Advisory
IMPORTANT
Defects Fixed
Additional Features and Functionality
Additional Notes

Release 1.8.1, Monday December 28, 2015

Security Advisory
Additional Features and Functionality
Additional Notes

Release 1.8.0, Sunday November 22, 2015

IMPORTANT
Additional Features and Functionality
Additional Notes

Release 1.7, Thursday April 7, 2011

Additional Features and Functionality
Additional Notes

Release 1.6.1, Monday February 8, 2010

Release 1.6, Thursday February 4, 2010

Defects Fixed
Security Advisory
Additional Features and Functionality
Additional Notes

Release 1.5, Tuesday August 18, 2009

Defects Fixed
Security Advisory
Additional Features and Functionality
Additional Notes

Release 1.4, Thursday August 8, 2008

Defects Fixed
Additional Features and Functionality
Additional Notes

Release 1.3, Saturday December 8, 2007

ASN.1 stream parsing now handles definite length encodings efficiently.
Buffering in the streaming CMS has been reworked. Throughput is now usually higher and the behaviour is more predictable.
BcpgInputStream now handles data blocks in the 2**31->2**32-1 range.
Some confusion over the parameters J and L in connection with Diffie-Hellman has been resolved.
Added CryptoApiRandomGenerator, a wrapper for RNGCryptoServiceProvider.
Added VMPC stream cipher, VMPCMAC and a VMPC-based implementation of IRandomGenerator.
Added support in OpenPGP for fetching keyrings by case-insensitive user ID [#BMA-8].
Fixed a vulnerability of CMS signatures that do not use signed attributes (Bleichenbacher RSA forgery).
Fixed a bug causing second and later encrypted objects to be ignored in KeyBasedFileProcessor example.
Fixed case-sensitivity issue with deletion from a PKCS#12 file.
Fixed problem overwriting entities in a PKCS#12 file.
Fixed PgpUtilities.MakeKeyFromPassPhrase for 8-bit characters [#BMA-13].
Fixed duplicate certificate problem in Pkcs12Store.Save [#BMA-12].
Fixed NAnt build under Mono [#BMA-10].
Fixed BigInteger.ModPow for negative exponents [#BMA-7].

Release 1.2, Thursday July 5, 2007

Source now builds on .NET Compact Framework 1.0 (compilation flag NETCF_1_0).
Release assembly now signed with a strong name.
Added CCM and EAX block cipher modes.
Added Noekeon block cipher.
Added HC-128, HC-256, and ISAAC stream ciphers.
Added RIPEMD160withECDSA signature algorithm.
Added support for notation data signature subpackets to OpenPGP.
Added support for parsing of experimental signatures to OpenPGP.
Added the complete set of SEC-2 EC curves.
Added support for implicit tagging to DerApplicationSpecific.
Added remaining ASN.1 structures from RFC 3126 to Asn1.Esf namespace.
Performance of ECDSA improved.
Performance of ASN.1 stream parsing improved.
Fixed default private key length for Diffie-Hellman parameters.
Fixed DerT61String to correctly support 8-bit characters.
Fixed duplicate attribute problem in Pkcs12Store.Save.
Fixed a problem writing public keys in OpenPGP [#BMA-5].

Release 1.1, Friday May 4, 2007

Added support for writing DSA private keys, and more encodings, in OpenSsl (PemReader/PemWriter).
Removed SharpZipLib dependency.
Added RSA blinded signature classes.
Added Asn1.IsisMtt namespace (ISIS-MTT ASN.1 classes).
Added SEED block cipher engine.
Added Salsa20 stream cipher engine.
Performance optimisations for F2m elliptic curves.
Fixed OpenPGP bug decrypting files with multiple types of encryption on the session key.

Release 1.0, Thursday January 18, 2007

Implementations of CMS, OCSP, OpenPGP, and TSP.
Elliptic Curves (F2m and Fp).
A basic TLS client.
PEM file reading and writing.
Symmetric key algorithms: Camellia, GOST28147, NaccacheStern, and TEA/XTEA.
Symmetric key modes: GOFB and OpenPGPCFB.
Symmetric key paddings: ISO7816d4.
Asymmetric key algorithms: RSA blinding.
Digests: GOST3411 and Whirlpool.
Macs: GOST28147 and ISO9797 Alg 3.
Signer mechanisms: ECDSA, ECGOST3410, and GOST3410.
...and many more features, bug fixes, and performance improvements.

Tuesday Febuary 1, 2005

This is the second beta release of the Bouncy Castle API C# implementation.
Reliability improvement to ASN1InputStream.
The OID entries in SignerUtilities for RSA signature algorithms for SHA-256,
SHA-384, and SHA-512 were pointing creating the wrong signature objects.

Sunday December 12, 2004

This is the first beta release of the Bouncy Castle Cryptographic API C# implementation.
The Legion of the Bouncy Castle would like to extend their thanks to all those who contributed to this API during the alpha stages of its development.
Keep up the good work folks.
Please send any questions or bug reports to dev-crypto-csharp@bouncycastle.org


Trademarks.

C#, .NET, and MSDN are Registered Trademarks of Microsoft. Microsoft.com
Java is a Registered Trademark of Sun Microsystems. Sun Microsystems


© 2007 Legion of the Bouncy Castle