pokt-network / pocket

Official implementation of the Pocket Network Protocol v1
https://pokt.network
MIT License
61 stars 33 forks source link

Secretbox keys #780

Closed h5law closed 1 year ago

h5law commented 1 year ago

Description

This PR updates the V1 codebase to encrypt keys using NaCl (libsodium) SecretBox cipher instead of AES-GCM due to the large number of benefits. These include the ability to use a random nonce, excellent efficiency for small messages (our keys are small) and the XSalsa20 stream cipher used by SecretBox provides a higher confidence in its security compared to AES and is a faster safer implementation compared to AES.

This change means V0 keys are now only partially interoperable with V1 and can now only be imported via their private hex strings.

A tool to convert V0 JSON files to V1 JSON files: https://gist.github.com/h5law/b5fde79f629ba960886b98ac12de6536 at a later date this can be implemented into the web wallet or CLI.

Summary generated by Reviewpad on 14 Jun 23 13:31 UTC

This pull request contains various updates related to the Keybase module in the codebase. It includes changes to the implementation of private key encryption and armouring, child key generation, and interoperability between protocols. The TestKeybase_ImportKeyFromStringNoPassphrase test function has been updated and is passing, and the debug_keybase.bak file has changed in the build/debug_keybase directory. Additionally, CHANGELOG.md has been updated with new version releases 0.0.0.35, 0.0.0.49, and 0.0.0.61, with changes to encryption and backup binary. Finally, the shared/crypto/README.md file has been updated with documentation related to cryptographic operations in this package.

Issue

Fixes N/A

Type of change

Please mark the relevant option(s):

List of changes

Testing

Required Checklist

If Applicable Checklist

h5law commented 1 year ago

@Olshansk bump

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (2489d3b) 31.52% compared to head (1a4293c) 31.52%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #780 +/- ## ======================================= Coverage 31.52% 31.52% ======================================= Files 107 107 Lines 9034 9034 ======================================= Hits 2848 2848 Misses 5846 5846 Partials 340 340 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.