Skip to content

Use WebCrypto APIs for AES & SHA operations #691

@zone117x

Description

@zone117x

Related issues:

Current associated PR: #737
Initial experimental PoC PR: #659

Solve some of the CPU & memory issues with our crypto operations, especially as it relates to:

  • User account registration and restoration.
  • File encryption and decryption in the storage APIs.

Tasks:

  • Replace usage of Node.js crypto lib in the auth and storage modules with modern WebCrypto APIs.

    • Currently, when packaged for the web, Node.js crypto gets polyfilled with IE-era JS implementations. These are both large in file size, and CPU & memory inefficient. One symptom is significant lag during the related authenticator pages, especially on low-powered mobile devices.
  • Strategy for handling breaking changes for some public blockstack.js functions that must be converted from sync to async.

  • (Optional / not sure) Strategy for making downstream dependencies -- mostly bitcoinjs-lib & family packages -- to use W3C crypto APIs rather than the Node.js crypto polyfills or other redundant libs.


Projects that need updated -- higher priority:

Lower priority:

  • iOS SDK
  • Android SDK (uses its own native crypto functions?)
  • react native SDK (?)
  • Wallet app

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions