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

Add cryptographic functions to SDK #4

Merged
merged 8 commits into from
Mar 24, 2020
Merged

Add cryptographic functions to SDK #4

merged 8 commits into from
Mar 24, 2020

Conversation

liangyuanruo
Copy link
Contributor

@liangyuanruo liangyuanruo commented Mar 22, 2020

Problem

The SDK currently contains utilities for web hook signature verification, but is incomplete without the functionality necessary to decrypt form responses.

Solution

This PR adds the following functionality under the crypto module:

  • Decryption
  • Encryption
  • Keypair generation
  • Keypair validation

as well as corresponding tests for the above.

Post-merge

Bump minor version number and publish to NPM.

Reviewers, please take note that this is a public repository.

FormSG today, with minor changes

- Renamed functions to expose a decrypt/encrypt method
- To be consistent with decrypt(), encrypt() now accepts an array of
Response objects instead of a JSON string
- Renamed privateKey to secretKey for consistency with nacl library
README.md Outdated Show resolved Hide resolved
lshaowei18
lshaowei18 previously approved these changes Mar 24, 2020
Copy link

@lshaowei18 lshaowei18 left a comment

Choose a reason for hiding this comment

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

Lgtm!

- Import crypto modules statically rather than by calling crypto()
- Variable renaming
- JSDoc improvements
@liangyuanruo liangyuanruo merged commit 0a5f44c into master Mar 24, 2020
@liangyuanruo liangyuanruo deleted the decrypt branch March 24, 2020 01:58
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.

2 participants