Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pkcs7 #87

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Pkcs7 #87

wants to merge 6 commits into from

Conversation

siccegge
Copy link

@siccegge siccegge commented Sep 8, 2017

Hi there!

I'm currently in need for PKCS#7 support and therefore looking into it. Obviously the current state (as in this PR) is crap and should not be used as-is. However I do have some questions

The most pressing Problem seems to be the Encoding. PKCS#7 on purpose employes undefined length BER encoding which is near-impossible to fit onto the current asn.1 implementation (You only learn the length of an object once you have parsed all its (recursive) children.

On a lesser thing: having this be Crypto.IO.PKCS7 sounds fine? How do you actually test Python2.4 support? Do you all have some VM around that has this somewhat dated version opf python installed?

 - Can decrypt a RSA PKCS1.5 message with AES data encryption
 - lacks much of general algorithm support which should be "easy" now
 - lacks all of proper error handling / reporting
 - lacks documentation
 - lacks tests
@siccegge
Copy link
Author

Hi again!

This is now mostly enough of a hack to do what I immediately need.
What remains is making the code actually "publishable" and nice for inclusion

I haven't really figured out how to deal with the BER stuff. I'm thinking of making the Der/Ber/.. thing a mixin to the existing datatypes maybe.

What are your opinions on using an already existing external asn.1 library?

@Legorooj
Copy link
Contributor

Legorooj commented Jan 2, 2020

PKCS#7 is now supported:

from Crypto.Util.Padding import pad
padded-data = pad(data, block_size, 'pkcs7'). #pkcs7 is the default mode

This pull request should be closed.

@siccegge did you receive this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants