SIGN MESSAGE

Sign a message can help you to validate your identity. Signing messages requires your private key.

Important: Prototypes.GQ is not storing information, please keep it mind.


VERIFY MESSAGE

To verify a message you must paste the decrypted message and the signed message, this will return the Public Key who signed it.



HOW IT WORKS?

It is not black magic! It just uses a public
Javascript Library called Ethers.js

									var providers = ethers.providers;
var provider = providers.getDefaultProvider();
hljs.initHighlightingOnLoad();

function Sign() {
	var privateKey = $("[name=input-private-key]").val();
	var message = $("[name=input-message]").val();
	if(!privateKey.length || !message.length)
		return;
	var wallet = new ethers.Wallet(privateKey);
	var signedMessage = wallet.signMessage(message)
	setTimeout(() => {
		$("div#info").show();
		$("#input-public-key").val(wallet.address)
		$("textarea#signed-message").val(signedMessage);
	}, 500);
}

function Verify() {
	var decryptedMessage = $("[name=input-decrypted-message]").val();
	var signedMessage		 = $("[name=input-signed-message]").val();
	var signer = ethers.Wallet.verifyMessage(decryptedMessage, signedMessage);
	setTimeout(() => {
		$("div#info-signer").show();
		$("[name=input-public-key-signer]").val(signer);
	}, 500)
}