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

Add OAEP encoding that uses SHA-256 #98

Closed
wants to merge 6 commits into from

Conversation

matehat
Copy link
Contributor

@matehat matehat commented Apr 18, 2021

This is mainly a clone of the OAEPEncoding class, but using a SHA-256 hash.

This has been verified as compatible with:

Still to do: incorporate in the package RSA tests and name-based encoding resolution. I honestly don't know the best way to go about this. I'm really not familiar with the package standards in that regard.


Edit

Now, there's a single class OAEPEncoding that exposes new factories to use different digests. Only SHA256Digest has been tested and verified.

This PR does not break existing code in any way.

@mwcw
Copy link
Collaborator

mwcw commented Apr 22, 2021

Hi,

Thanks very much for this for testing take look at where sha256 is used as both mask and hash function.

[https://github.com/bcgit/bc-java/blob/master/core/src/test/java/org/bouncycastle/crypto/test/OAEPTest.java#L792]

and

[https://github.com/bcgit/bc-java/blob/master/core/src/test/java/org/bouncycastle/crypto/test/OAEPTest.java#L812]

MW

@epoberezkin
Copy link

epoberezkin commented Oct 21, 2021

@matehat - compatible with Haskell OAEP implementation in cryptonite as well (with default parameters in cryptonite, when I use withSHA256 constructor).

@mwcw - any reason not to merge it?

@epoberezkin
Copy link

It probably just misses doc comments...

@johannalamm
Copy link

It would be great if this could be merged😇🙏

@fredrik-w
Copy link

Would really like this merged! 🙏

@dharmadeveloper108
Copy link

It works great!! Would be awesome if it was merged! :)

@bryanlee-hdj
Copy link

bryanlee-hdj commented Dec 21, 2021

By using this P.R, does it make usable the java Cipher class's "RSA/ECB/OAEPWithSHA-256AndMGF1Padding" on the Flutter? (I'm the newbie in the Crypto & Security fields =))

I'd like to know if this PR could handle the above algorithm case.

@bkhezry
Copy link

bkhezry commented Dec 27, 2021

Is there any update on when this PR will be merged?

@mwcw
Copy link
Collaborator

mwcw commented Dec 29, 2021

Is there any update on when this PR will be merged?

I am adding more tests to it and endeavouring to exercise OAEP more generally.
I may push a new release this evening or more probably Thursday AU, Melbourne time.

MW

@mwcw
Copy link
Collaborator

mwcw commented Dec 30, 2021

Thanks,

I added further testing to this mainly for SHA256.

It will be synced shortly.

MW

@mwcw mwcw closed this Dec 30, 2021
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

8 participants