PHPECC | simple frontend to Matyas Danter
kandi X-RAY | PHPECC Summary
kandi X-RAY | PHPECC Summary
A simple frontend to Matyas Danter’s phpecc libraries for the EC algorithm. Usage information can be seen in the example.php file or at:
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Compute factorization
- Multiplies two points .
- Verify a hash
- Checks if a point is valid
- Get public point
- Generate a curve PEM
- Returns true if the matrix contains the given x .
- Convert decimal string to hexadecimal
- Returns the parameters for the secp - 128 .
- Convert a gMP private private key to hex
PHPECC Key Features
PHPECC Examples and Code Snippets
Community Discussions
Trending Discussions on PHPECC
QUESTION
I'm trying to generate a shared secret between a web server running PHP and a C# desktop application. I'm aware of the BouncyCastle library, but I'd prefer not having to use it since it's pretty huge.
I'm using phpecc and ECDiffieHellmanCng and trying to generate a shared secret between the two parties but I'm having issues with exporting/importing in C#.
It seems phpecc requires der/pem format in order to import a key, and ECDiffieHellmanCng doesn't seem to have any easy way to export in a compatible format.
Would I need to write my own pem/der encoder and decoder in order to do this or is there some alternative easier way?
Currently I'm doing the following in C#:
...ANSWER
Answered 2017-May-10 at 15:52.NET Core 1.0 and .NET Framework 4.7 have the ECParameters struct to import/export keys. The ToByteArray()
method you called is producing a CNG EccPublicBlob which has very little to do with the SEC-1 ECParameters format.
I'm going to assume that you wanted to use secp384r1/NIST P-384, even though you specified that as a hash algorithm. If you want some other curve, you'll need to do some translations.
The (.NET) ECParameters struct will only help you get started. Turning that into a file requires translating it into a PEM-encoded DER-encoded ASN.1-based structure. (But if you're sticking with NIST P-256/384/521, you can do it with the byte[] you currently have)
In SEC 1 v2.0 we get the following structures:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install PHPECC
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
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