Methods
cipherData(data, secret) → {string}
Encrypts data
Parameters:
Name | Type | Description |
---|---|---|
data |
string | Data to encrypt |
secret |
string | Encryption secret |
- Source:
Returns:
- Type
- string
cipherMessage(message) → {*}
Encrypts data field in message
Parameters:
Name | Type | Description |
---|---|---|
message |
object | Message object |
- Source:
Returns:
- Type
- *
createSecret(externalPublic) → {string}
Create secret key based on external public key
Parameters:
Name | Type | Description |
---|---|---|
externalPublic |
string |
- Source:
Returns:
- Type
- string
decipherData(encryptedData, secret) → {string}
Decripts data
Parameters:
Name | Type | Description |
---|---|---|
encryptedData |
string | Encrypted data source |
secret |
string | Encryption secret |
- Source:
Returns:
- Type
- string
decipherMessage(message) → {*}
Decrypts data field in message
Parameters:
Name | Type | Description |
---|---|---|
message |
object | Message object |
- Source:
Returns:
- Type
- *
generateKeys() → {*}
Get public key object for Diffie-Hellman
- Source:
Returns:
- Type
- *
handleIncomingMessage(message) → {*}
Processes incoming message
Parameters:
Name | Type | Description |
---|---|---|
message |
- Source:
Returns:
- Type
- *
makeConnection(messageBus, cb) → {StarwaveCrypto}
Make encrypted connection
Parameters:
Name | Type | Description |
---|---|---|
messageBus |
string | Connection address |
cb |
function | Connection callback 1 - receiver, 2 - secret key |
- Source:
Returns:
- Type
- StarwaveCrypto
sendMessage(message) → {number}
Send message using encryption protocol
Parameters:
Name | Type | Description |
---|---|---|
message |
object | Data for sending |
- Source:
Returns:
Status
- Type
- number