Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add encryption #58

Merged
merged 10 commits into from
Mar 25, 2019
Merged

[FEATURE] Add encryption #58

merged 10 commits into from
Mar 25, 2019

Conversation

boodyvo
Copy link
Contributor

@boodyvo boodyvo commented Jan 31, 2019

Add encryption for socket messages for invoice (compatible for receive from an old version of wallet, but cannot send to an old version of wallet)

settings.ini Outdated
@@ -13,17 +13,17 @@ maxpendingchannels = 5

[bitcoin]
active = true
node = neutrino
network = mainnet
node = btcd
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert settings

@@ -19,14 +23,28 @@ const types = {
SOCKET_UNAUTHORIZED_CONNECTION: "UNAUTHORIZED_CONNECTION",
SOCKET_SIGN_MESSAGE_SUCCESS: "SIGN_MESSAGE_SUCCESS",
SOCKET_ADD_INVOICE_REMOTE_RESPONSE: "ADD_INVOICE_REMOTE_RESPONSE",
SOCKET_ADD_INVOICE_ENCRYPTED_REMOTE_RESPONSE: "ADD_INVOICE_ENCRYPTED_REMOTE_RESPONSE",
SOCKET_ADD_INVOICE_REMOTE_REQUEST: "ADD_INVOICE_REMOTE_REQUEST",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate with line 17

invoiceResponse[key] = null;
const id = `${Date.now()}${crypto.randomBytes(5).toString("hex")}`;

// const defParams = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftoff?

@lverba
Copy link
Contributor

lverba commented Feb 12, 2019

retest this please

@lverba
Copy link
Contributor

lverba commented Feb 14, 2019

retest this please

@boodyvo boodyvo changed the title Add encryption [FEATURE] Add encryption Feb 18, 2019
@lverba
Copy link
Contributor

lverba commented Feb 27, 2019

retest this please

1 similar comment
@lverba
Copy link
Contributor

lverba commented Mar 12, 2019

retest this please

// timout for saving shared keys - 1 hour
const KEY_SAVE_TIMEOUT = 60 * 60 * 1000;
// local storage for shared keys
// let keyStorage = {};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something left from dev

const pubkey = ec.keyFromPublic(msg.data.pubkey, "hex");
// remember shared key for particular id

// for test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left from testing/dev or necessary part?

break;
}
case types.SOCKET_PUBKEY_RESPONSE: {
logger.debug("Will check auth", invoiceStorage[msg.data.id]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup logger, remove unnecessary, duplicated(for comments too)

@boodyvo boodyvo merged commit c92401c into master Mar 25, 2019
@serhiislobodian serhiislobodian deleted the msg-encryption branch March 29, 2019 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants