msrCrypto | GitHub mirror of the MSR JavaScript Cryptography Library | Runtime Evironment library
kandi X-RAY | msrCrypto Summary
kandi X-RAY | msrCrypto Summary
GitHub mirror of the MSR JavaScript Cryptography Library
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- PUBLIC CONSTRUCTor
- square - bit algorithm
- Creates a new MD - prime with the given exponent .
- Constructs an integer group .
- Creates an entropy entropy entropy entropy .
- Creates a new PSNG .
- Adds two affine points
- Adds two doubles points
- Divide a dividend of a dividend
- Efficient function for E .
msrCrypto Key Features
msrCrypto Examples and Code Snippets
Community Discussions
Trending Discussions on msrCrypto
QUESTION
I have a server which uses MSRCrypto to sign my nonce. I need to verify that nonce in Java. It is well know that MSRCrypto sends it in P1363 format and Java Library requires it in DER format.
I cannot change the server code as I am the client. The server is using SHA386withECDSA
1) Can someone provide me with exact code snippet to convert it from P1363 format to ASN.1 and vice-versa(ASN.1 to P1363) in Java. I tried a few code snippets but was not able to make it work (because those snippets were in C, C++).
2) Is there a library which I can use to do these conversion without writing it myself. Like does Bouncy Castle provide this?
What I am aware ofI am also aware that I can use BouncyCastle with SHAXwithPLAIN-ECDSA
or with SHAXwithCVC-ECDSA
. However Bouncy Castle/ Spongy Castle is slow when running this on Android because it does not do native calls. The support is also available in Java 9 but I am still using Java 8.
ANSWER
Answered 2020-May-18 at 16:07BouncyCastle doesn't have a facility to directly convert one signature format to the other. It does have a general-purpose ASN.1 encoding/decoding library (for both DER and BER, although crypto uses almost entirely DER) which can handle the ASN.1 half, but you still have to do the 'plain' (P1363, CVC, PKCS11, Microsoft) half, which is dead easy on the input (decode) side but a little harder on the output (encode) side. For that format you need to know and use the size in octets of the curve order (or more exactly the generator and subgroup order, which sometimes differs from the underlying curve), which I call n here.
I show very limited error handling, consisting of throwing an uninformative Exception and letting the JVM display it. In a real program you will want to do better, but what you will want to do varies.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install msrCrypto
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page