Comments (6)
First of all, I must apologize for replying late as I am just seeing this issue now.
GitHub unfortunately didn't notify me that an issue was created.
I have done something similar to what you want but for Blake2B.
Links can be found below
Other relevant links
using the above links as guidelines, you can create your own variant which uses SHA3-512.
do feel free to reach out if you encounter any other issues along the way.
Regards.
from cryptolib4pascal.
from cryptolib4pascal.
Hello, strangely again, GitHub didn't notify me of your update.
Got to see it by chance.
To answer your question, Nem used SHA3-512 before it was standardized as SHA-3 by NIST which essentially means that Nem uses KECCAK-512.
So the hash you need is
result := TDigestUtilities.GetDigest('KECCAK-512');
from cryptolib4pascal.
Hello again. No worries! And thanks a lot for checking from time to time.
I forgot to mention that I also tested with KECCAK-512. But unfortunately this didn't work out either :-(
Private Key: 4ba47b6ace2abe73ef593c3cf32a999fb57349a6038bc334d3b50edff8bd33f6
Expected Public Key: 576192500b07f5c78482d05cb17bfcde61fcd819e447447ada0f7ad149928bf2
Generated Public Key: 473c6df8dbbbde579b700323cd4f3d0df868573868bf1d9a53c30a2056d0ff5a
Hhmmm... I was pretty sure that with NEM the only difference to the standard Ed25519 implementation is the hash function. But maybe there is more...
Again, thank you very much for your support so far.
Best regards
Guido
from cryptolib4pascal.
Hello again. No worries! And thanks a lot for checking from time to time.
I forgot to mention that I also tested with KECCAK-512. But unfortunately this didn't work out either :-(
Private Key: 4ba47b6ace2abe73ef593c3cf32a999fb57349a6038bc334d3b50edff8bd33f6
Expected Public Key: 576192500b07f5c78482d05cb17bfcde61fcd819e447447ada0f7ad149928bf2
Generated Public Key: 473c6df8dbbbde579b700323cd4f3d0df868573868bf1d9a53c30a2056d0ff5aHhmmm... I was pretty sure that with NEM the only difference to the standard Ed25519 implementation is the hash function. But maybe there is more...
Again, thank you very much for your support so far.
Best regards
Guido
Hi, so I did some research about Nem and discovered that the private key is first reversed (as a byte array) before passed to the ED25519 method.
The code below gives me 576192500b07f5c78482d05cb17bfcde61fcd819e447447ada0f7ad149928bf2 as my public key.
var
sk, skreversed: TBytes;
privateKey: IEd25519Blake2BPrivateKeyParameters;
publicKey: IEd25519Blake2BPublicKeyParameters;
pk: string;
i: Int32;
begin
sk := DecodeHex
(('4ba47b6ace2abe73ef593c3cf32a999fb57349a6038bc334d3b50edff8bd33f6'));
System.SetLength(skreversed, length(sk));
for i := Low(sk) to High(sk) do
begin
skreversed[High(sk) - i] := sk[i];
end;
privateKey := TEd25519Blake2BPrivateKeyParameters.Create(skreversed, 0);
publicKey := privateKey.GeneratePublicKey;
pk := EncodeHex(publicKey.GetEncoded);
end;
** Note, I used Keccak-512 as the digest.
from cryptolib4pascal.
Hello again
Wow! Thanks a lot! Works like a charm!
Donation is on the way...
Best regards
Guido
from cryptolib4pascal.
Related Issues (20)
- Decrypt function customize fail, advice to me. plz. HOT 1
- SSH ECDH problem HOT 6
- About ed25519 signature verification HOT 16
- GE HOT 2
- Keypair generation and sign/verify using ECDSA + sha1 HOT 2
- Simple examples of usage. HOT 1
- Lazarus form examples? HOT 10
- Installer HOT 1
- Example with CryptoJS AES HOT 1
- Circular unit reference to 'ClpBigInteger' HOT 4
- Cryptographically-secure pseudorandom number generator - CPRNG HOT 2
- SHA256WITHDSA verify problem HOT 2
- Access violation in rtl270.bpl HOT 2
- Convert mnemonic to adresses
- Several compilation errors HOT 20
- Test Project does compile (Delphi) HOT 9
- Using this in RAD Studio 11 HOT 1
- I can't find aes/gcm/nopadding ? I searched whole internet and can;t find anything. HOT 1
- HMAC-SHA256 help needed HOT 3
- Error TECPrivateKeyParameters create 'Scalar is not in the interval[1, n-1]' HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cryptolib4pascal.