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

Operation request: RSA operations #272

Closed
n1474335 opened this issue Mar 23, 2018 · 9 comments
Closed

Operation request: RSA operations #272

n1474335 opened this issue Mar 23, 2018 · 9 comments

Comments

@n1474335
Copy link
Member

Summary

Various RSA-related operations could be added. As we are already importing the forge library, it would make sense to utilise it for this.

Possible operations:

  • Generate RSA key pair
  • RSA sign
  • RSA verify
  • RSA encrypt
  • RSA decrypt
@GCHQ77703
Copy link
Member

GCHQ77703 commented Aug 30, 2018

Started work under the rsa branch, current progress:

  • Generate RSA Key Pair
  • RSA Sign
  • RSA Verify
  • RSA Encrypt
  • RSA Decrypt

@mattnotmitt
Copy link
Collaborator

mattnotmitt commented Aug 31, 2018

@GCHQ77703 I assume we're waiting for this to merge? I've tried using your branch but generation isn't working due to a dynamic import of prime.worker.min.js not resolving correctly due to webpack.

EDIT: I've managed to finally make it import with a hacky solution using raw-loader but we still need this PR to merge for self to be an available scope inside the worker.

Another edit: Looks like we've run around into the OperationConfig issue again, which is the actual reason for the self error with the hacky import. A quick explanation of what I'm doing to try and get this to work in this commit. By loading the file as a raw blob we can provide it as a URL for forge to load. This should work, however we cannot actually check this because when OperationConfig is being generated, every file is imported and as such, their imports are also loaded, and as the worker looks like a normal import to node, attempts to load that too. However this won't work because self is not defined in node's scope. Right now the only thing I can think of is using dynamic import when it's added but who knows when that'll be.

@GCHQ77703
Copy link
Member

GCHQ77703 commented Aug 31, 2018

@artemisbot Do these issues not occur in the grunt dev development environment? I was able to seemingly generate RSA keys on a worker thread from just my previous code.

Although I must admit to having never used workers before for anything more than caching, some of the operations were taking 5-10 seconds of time with no degradation of the UI, which implies it is successfully being sent off to another worker thread.

@mattnotmitt
Copy link
Collaborator

mattnotmitt commented Aug 31, 2018 via email

@GCHQ77703
Copy link
Member

screen shot 2018-08-31 at 12 37 07

My build doesn't seem to note any issues, and my cyber chef instance appears to be functional:

screen shot 2018-08-31 at 12 37 58

@mattnotmitt
Copy link
Collaborator

mattnotmitt commented Aug 31, 2018

Ooh, interesting. It worked fine in Chrome/Chromium when I just tested it but doesn't in Firefox which is what I use normally. Wonder what's causing that? (this is on exactly the same dev build and machine)

@GCHQ77703
Copy link
Member

Ah, true. Can reproduce the problem in Firefox.

Might indeed need to wait on merging this.

@mattnotmitt
Copy link
Collaborator

Looks like digitalbazaar/forge#645 merged, I've just checked and it seems to be working totally fine with the previous branch. Going to clean up the operation and create a PR.

@mattnotmitt mattnotmitt mentioned this issue Sep 30, 2019
5 tasks
@n1474335
Copy link
Member Author

n1474335 commented Feb 1, 2021

Thanks for all your work. This has now been implemented and merged in #652

@n1474335 n1474335 closed this as completed Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants