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

Challenge 2 woes #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Challenge 2 woes #1

wants to merge 2 commits into from

Conversation

gichiba
Copy link

@gichiba gichiba commented Jan 25, 2021

I have two theories why this code doesn't work:

  1. There's something about the decimal/hex issue that I don't understand, so the keys are not matching up like they should.

  2. I haven't correctly imported or otherwise configured the elliptic library correctly on the client side, and so none of those functions are actually working, but still somehow the site builds.

@Dan-Nolan
Copy link
Contributor

Dan-Nolan commented Jan 26, 2021

It looks like everything is wired up properly as far as imports. I think the main trouble you're running into is that you're trying to use elliptic key methods on strings.

Like here for instance.

In order to get the key methods, you'll first have to convert from a string to a en ec key like:

const privateKey = document.getElementById("exchange-key");
const key = ec.keyFromPrivate(privateKey, 'hex');

👆 After this you'll be able to use key.sign. Similar issue on the server-side. Otherwise I think this looks pretty close!

ss251 added a commit to ss251/ECDSA-Exchange that referenced this pull request May 16, 2022
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