Comments (2)
Thanks. We will consider your wish.
from wavesgui.
I see here: https://waveswallet.io/js/waves-lite-client-mainnet-0.5.22.js
in this https://waveswallet.io/
there is some code to sign and verify messages:
axlsign.openMessage = function(publicKey, signedMsg) {
checkArrayTypes(signedMsg, publicKey);
if (publicKey.length !== 32) throw new Error('wrong public key length');
var tmp = new Uint8Array(signedMsg.length);
var mlen = curve25519_sign_open(tmp, signedMsg, signedMsg.length, publicKey);
if (mlen < 0) return null;
var m = new Uint8Array(mlen);
for (var i = 0; i < m.length; i++) m[i] = tmp[i];
return m;
};
axlsign.sign = function(secretKey, msg, opt_random) {
checkArrayTypes(secretKey, msg);
if (secretKey.length !== 32) throw new Error('wrong secret key length');
if (opt_random) {
checkArrayTypes(opt_random);
if (opt_random.length !== 64) throw new Error('wrong random data length');
}
var buf = new Uint8Array((opt_random ? 128 : 64) + msg.length);
curve25519_sign(buf, msg, msg.length, secretKey, opt_random);
var signature = new Uint8Array(64);
for (var i = 0; i < signature.length; i++) signature[i] = buf[i];
return signature;
};
axlsign.verify = function(publicKey, msg, signature) {
checkArrayTypes(msg, signature, publicKey);
if (signature.length !== 64) throw new Error('wrong signature length');
if (publicKey.length !== 32) throw new Error('wrong public key length');
var sm = new Uint8Array(64 + msg.length);
var m = new Uint8Array(64 + msg.length);
var i;
for (i = 0; i < 64; i++) sm[i] = signature[i];
for (i = 0; i < msg.length; i++) sm[i+64] = msg[i];
return (curve25519_sign_open(m, sm, sm.length, publicKey) >= 0);
};
And
// function accepts buffer with private key and an array with dataToSign
// returns buffer with signed data
// 64 randoms bytes are added to the signature
// method falls back to deterministic signatures if crypto object is not supported
this.nonDeterministicSign = function(privateKey, dataToSign) {
var crypto = window.crypto || window.msCrypto;
var random;
if (crypto) {
random = new Uint8Array(64);
crypto.getRandomValues(random);
}
var signature = axlsign.sign(privateKey, new Uint8Array(dataToSign), random);
return this.base58.encode(signature);
};
// function accepts buffer with private key and an array with dataToSign
// returns buffer with signed data
this.deterministicSign = function(privateKey, dataToSign) {
var signature = axlsign.sign(privateKey, new Uint8Array(dataToSign));
return this.base58.encode(signature);
};
this.verify = function(senderPublicKey, dataToSign, signatureBytes) {
return axlsign.verify(senderPublicKey, dataToSign, signatureBytes);
};
And maybe this can be processed client-side.
Also, I see some scripts here: https://github.com/wavesplatform/waves-signature-generator
But this is for node.js, and I don't know how to build and install this...
P.S.: Yeap, this working with some modifications. See this issue: https://github.com/wavesplatform/Waves/issues/2625
from wavesgui.
Related Issues (20)
- WalletGui does not download the folder "Locale" HOT 1
- Getting search query length doesnt work in Chrome on Linux HOT 9
- App crashed in server online HOT 1
- Hosting wallet waves HOT 1
- Personalized wallet on my server HOT 2
- Не прогружаются транзакции, и лезут ошибки в консоли браузера. HOT 6
- error in npm i HOT 3
- Source code of https://wavesblockexplorer.com/ HOT 4
- [SOLVED] Custom matcher - not working in waves-client, without HTTPS. HOT 13
- [FEATURE] Order expiration and auto-prolongation. HOT 1
- [SECURITY BUG] Cross-site Scripting (XSS)
- [SECURITY BUG] Cross-site Scripting (XSS) # 2 HOT 1
- [BUG] Denial of Service (DoS) HOT 1
- trading view HOT 2
- [BUG]
- [FEATURE] Build compatibility with Windows HOT 2
- Desktop client HOT 1
- [Security Issue]"contextIsolation" is disabled HOT 4
- https://github.com/wavesplatform/WavesGU has outdated link to client.wavesplatform.com
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 wavesgui.