bc-csharp | BouncyCastle.NET Cryptography Library | Cryptography library

 by   bcgit C# Version: release-2.2.1 License: MIT

kandi X-RAY | bc-csharp Summary

kandi X-RAY | bc-csharp Summary

bc-csharp is a C# library typically used in Security, Cryptography applications. bc-csharp has no bugs, it has a Permissive License and it has medium support. However bc-csharp has 1 vulnerabilities. You can download it from GitHub.

Bouncy Castle C# Distribution (Mirror)
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              bc-csharp has a medium active ecosystem.
              It has 1273 star(s) with 485 fork(s). There are 100 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 124 open issues and 206 have been closed. On average issues are closed in 372 days. There are 14 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of bc-csharp is release-2.2.1

            kandi-Quality Quality

              bc-csharp has 0 bugs and 0 code smells.

            kandi-Security Security

              bc-csharp has 1 vulnerability issues reported (0 critical, 0 high, 1 medium, 0 low).
              bc-csharp code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              bc-csharp is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              bc-csharp releases are not available. You will need to build from source code and install.
              bc-csharp saves you 480 person hours of effort in developing the same functionality from scratch.
              It has 1177 lines of code, 0 functions and 2426 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bc-csharp
            Get all kandi verified functions for this library.

            bc-csharp Key Features

            No Key Features are available at this moment for bc-csharp.

            bc-csharp Examples and Code Snippets

            No Code Snippets are available at this moment for bc-csharp.

            Community Discussions

            QUESTION

            BouncyCastle undefined length ASN1
            Asked 2020-May-28 at 09:31

            I try to get a X509Certificate2 from a BountyCastle X509Certificate and a PKCS12. I use the following code:

            ...

            ANSWER

            Answered 2020-May-28 at 09:31

            I found some bugreports on your problem with possible workarounds outlined. I don't have an appropriate environment to test this myself - sorry. But from the history it looks like it hasn't really been resolved:

            1. Bugreport:

            This explicitly states problems with BouncyCastle just like you experience. Sebastian Pouliot posts a sample code in comment3 that he thinks can be used (or parts of it) to work around the problem using mono.security.dll. I don't know if your usecase allows to use it. It is shipped with MonoDroid.
            He goes into details in this comment and has the example code linked on github: https://github.com/mono/mono/blob/master/mcs/tools/security/makecert.cs

            1. There is also someone else who posted a problem with this. BouncyCastle is not explicitly mentioned: http://lists.ximian.com/pipermail/mono-bugs/2010-October/104908.html

            His workaround at the end of post:
            [Once you have the correct PKCS#12] Quote:

            Write the byte[] PKCS#12 into a temporary file and load it with string constructor.

            Update on source provided in comments

            Hope my system worked correctly as it took hours to get it running. But then I got the following working.

            The solution is to change the StoreBuilder to UseDEREncoding to true

            Small bugfix up front
            Finding: You put in a string.empty as password but protected the cert with a password. I think this is not correct. If I put in the password I get the first error again CryptographicException Certificate cannot be coded to valid certificate.

            So first I changed this:

            Source https://stackoverflow.com/questions/44221620

            QUESTION

            How to create a PKCS#7 detached signature with .Net Core?
            Asked 2017-Dec-26 at 05:08

            I want to create PKCS#7 detached signature with .Net Core (2.0).

            I read all answers here more or less relevant to my issue and found this and this answers. All other were helpless. The first example do exactly what I need but it relies on .NetFramework.
            The second one use Bouncy Castle library and do little different but similar thing. I found Portable.BouncyCastle project worked on .Net Core. As I can understand it is the only option for me.

            This is the code from the first example with some modifications:

            ...

            ANSWER

            Answered 2017-Dec-26 at 05:08

            I found an another discussion that gave me a clue. There is a link to a GitHub repo with an example application. I modified it slightly and now it works as expected. Here is the code:

            Source https://stackoverflow.com/questions/47970223

            QUESTION

            Identify the recipient(s) KeyId from PGP encrypted data using the BouncyCastle C# library
            Asked 2017-Dec-03 at 17:55

            I have developed a library to perform PGP signing/encryption and decryption/validation of files against one or more recipients. This part works great and works with large files using streams nicely and efficiently.

            Part of the PGP Message Exchange Formats specification (RFC 1991) states the following:

            ...

            6.7 User ID Packet

            Purpose. A user ID packet identifies a user and is associated with a public or private key.

            Definition. A user ID packet is the concatenation of the following fields:

            (a) packet structure field (2 bytes);

            (b) User ID string.

            The User ID string may be any string of printable ASCII characters. However, since the purpose of this packet is to uniquely identify an individual, the usual practice is for the User ID string to consist of the user's name followed by an e-mail address for that user, the latter enclosed in angle brackets.

            ...

            The application I am creating will need to attempt to identify the appropriate key for decrypting the files automatically so that I have as little user intervention as possible. If the key can not be identified (for example, if the recipient(s) are hidden) the application will prompt for the selection of the correct key. I am trying to make it as streamlined as possible.

            The RFC suggests the packet is not part of the encrypted data which makes sense. PGP makes it easy to try and identify who encrypted the data. This is evident when you try and decrypt a file using Kleopatra when it has the relevant keys added to its key database. In this instance, it will prompt for the password protecting the secret key.

            My specific question is:

            How do I use the C# BouncyCastle library to read which recipients the encrypted data was intended to? In otherwords, which private key to use for decryption?

            I have tried to find examples using the Bouncy Castle GitHub repository and couldn't see any that demonstrated this particular problem. I also looked at as many google search results for this question to no avail.

            ...

            ANSWER

            Answered 2017-Dec-03 at 17:55

            I found the answer to my question. I assumed that if it was part of the PGP specification then it must be possible without too much bother. I therefore decided to scrutinise the decryption process and all of the objects used throughout it.

            Using the debugger I enumerated the items within the PgpEncryptedDataList and found the key ID for the public key that encrypted it inside the individual PgpPublicKeyEncryptedData object.

            The object contains a property of type long called KeyId. This was the value I was looking for to match against the keys stored in the application.

            The following snippet is just an example of what I used to reach the KeyId property:

            Source https://stackoverflow.com/questions/47618360

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install bc-csharp

            You can download it from GitHub.

            Support

            If you want to provide feedback directly to the members of The Legion then please use feedback-crypto@bouncycastle.org, if you want to help this project survive please consider donating. For bug reporting/requests you can report issues here on github, via feedback-crypto if required. We will accept pull requests based on this repository as well, but only on the basis that any code included may be distributed under the Bouncy Castle License.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/bcgit/bc-csharp.git

          • CLI

            gh repo clone bcgit/bc-csharp

          • sshUrl

            git@github.com:bcgit/bc-csharp.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Cryptography Libraries

            dogecoin

            by dogecoin

            tink

            by google

            crypto-js

            by brix

            Ciphey

            by Ciphey

            libsodium

            by jedisct1

            Try Top Libraries by bcgit

            bc-java

            by bcgitJava

            bc-kotlin

            by bcgitKotlin