?
Solved

Why can I not decrypt a file with BouncyCastle library?

Posted on 2010-01-13
7
Medium Priority
?
1,656 Views
Last Modified: 2013-12-17
I have tried to implement the BouncyCastle library to encrypt and decrypt files. When I encrypt a file with it I can also decrypt it. But when I try to decrypt a file from a counterparty I run into trouble.

I get an exception telling me "unknown block type", and if I follow the exception being thrown from there I get "exception decrypting secret key".

The secret key I'm trying to use works fine with PGP Desktop and with Gpg4win command line tool.

How is it possible that this generates an exception?
0
Comment
Question by:lynxSE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 39

Accepted Solution

by:
abel earned 1000 total points
ID: 26323404
A possible reason is that the file is not exactly in the format you expect it to be. For instance, perhaps it is sent to you in Base-64 or the chosen encryptions are different. I assume you already googled and have seen solutions like these?

This post shows that the incompatibility you mention is indeed correct and apparently a bug in the software. There's no follow-up, but you may try the mailing list yourself.

I assume BouncyCastle is ported to .NET with largely the same codebase as the Java codebase.
0
 

Author Comment

by:lynxSE
ID: 26323849
I have googled around but I'm not sure I could interpret the solution in a fashionable way. I have an alternative solution I will work with since this is (most likely) a bug in BouncyCastle. I am already on their mailing list but response I've been getting is not of great satisfaction.

I will use GPP command tool instead. Thank you for your time!
0
 
LVL 39

Expert Comment

by:abel
ID: 26324119
You're welcome! :)
0
 

Author Closing Comment

by:lynxSE
ID: 31676652
Didn't find a proper solution, but stated that there may be a bug in third party component.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The recent Petya-like ransomware attack served a big blow to hundreds of banks, corporations and government offices The Acronis blog takes a closer look at this damaging worm to see what’s behind it – and offers up tips on how you can safeguard your…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question