Closed saad-121 closed 2 years ago
Hi @shhs121,
Sorry for the late reply on this. For future googlers, it looks like you are importing ethereumjs-util
incorrectly. You can just say
import { bufferToHex } from 'ethereumjs-util';
Hope this helps.
I am trying to get the public key of a connected wallet, use it to encrypt data, and then use the private key of the same user to decrypt it. So far, I have used the following to get the public key:
Then, I use this function to encrypt:
I am using 'Hello World' just to test for starters.
I get this error "Cannot read properties of undefined (reading 'bufferToHex')". Sometimes when I change a few things, I get this "Cannot read properties of undefined (reading 'encrypt')". FYI, I plan to use this function to decrypt the encrypted data.
Here are the relevant dependencies:
I would appreciate some assistance. Thank you.