NanoMemoTools.tools module
- Source:
Methods
(inner) decryptMessage(cipher_text, nonce, signing_public_key, decrypting_private_key, version) → {string}
This function decrypts a message
Parameters:
Name | Type | Description |
---|---|---|
cipher_text |
string | encrypted message to decrypt |
nonce |
string | unique nonce to increase entropy |
signing_public_key |
string | 64-hex signing public key |
decrypting_private_key |
string | 64-hex decrypting private key |
version |
number | version of encryption algorithm - not yet implemented |
- Source:
Returns:
string representing unencrypted message
- Type
- string
(inner) encryptMessage(message, nonce, decrypting_public_key, signing_private_key, version) → {string}
This function encrypts a message
Parameters:
Name | Type | Description |
---|---|---|
message |
string | message to encrypt |
nonce |
string | unique nonce to increase entropy |
decrypting_public_key |
string | 64-hex encrypting public key |
signing_private_key |
string | 64-hex signing private key |
version |
number | version of encryption algorithm - not yet implemented |
- Source:
Returns:
string representing encrypted message
- Type
- string
(inner) getAddress(public_key) → {string}
Derive a Nano Account's address from a Nano public key
Parameters:
Name | Type | Description |
---|---|---|
public_key |
string | 64-hex string representing a public key |
- Source:
Returns:
Nano address: nano_*
- Type
- string
(inner) getPrivateKey(seed, index) → {string}
Derive a Nano Account's private key from a seed and index
Parameters:
Name | Type | Description |
---|---|---|
seed |
string | 64-hex string representing a Nano seed |
index |
number | index value of account |
- Source:
Returns:
64-hex private key
- Type
- string
(inner) getPublicKeyFromAddress(address) → {string}
Derive a Nano Account's public key from a Nano address
Parameters:
Name | Type | Description |
---|---|---|
address |
string | Nano address; nano_* or xrb_* |
- Source:
Returns:
64-hex public key
- Type
- string
(inner) getPublicKeyFromPrivateKey(private_key) → {string}
Derive a Nano Account's public key from a private key
Parameters:
Name | Type | Description |
---|---|---|
private_key |
string | 64-hex string representing a private key |
- Source:
Returns:
64-hex public key
- Type
- string
(inner) sign(buffer, private_key, versionopt) → {string}
This function calculates and returns a 128-hex string signature for given string buffer
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
buffer |
string | value to sign | |
private_key |
string | 64-hex string private key | |
version |
number |
<optional> |
version of signature algorithm - not yet implemented |
- Source:
Returns:
128-hex string signature
- Type
- string
(inner) verify(buffer, public_key, signature, version) → {boolean}
This function verifies a given signature is true for given buffer and key
Parameters:
Name | Type | Description |
---|---|---|
buffer |
string | string on which the signature is mapped |
public_key |
string | 64-hex string public key of keypair that signed the buffer |
signature |
string | 128-hex string signature of public_key on buffer |
version |
number | version of signature algorithm - not yet implemented |
- Source:
Returns:
true for verified, false otherwise
- Type
- boolean