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

Node 0.12.0 has 'bad decrypt' error #37

Open
sheldonth opened this issue Mar 16, 2015 · 2 comments
Open

Node 0.12.0 has 'bad decrypt' error #37

sheldonth opened this issue Mar 16, 2015 · 2 comments

Comments

@sheldonth
Copy link

Attempting to use bitauth as part of the bitpay node.js module, and seeing

crypto.js:202
  var ret = this._handle.final();
                         ^
Error: error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt
    at Error (native)
    at Decipher.Cipher.final (crypto.js:202:26)
    at Object.decrypt (/home/.../node_modules/bitauth/lib/decrypt.js:7:23)
    at new Bitpay (/home/.../bitpay.js:53:27)

Has this been encountered yet? Was not having this problem on Node 0.10.33, seems new to 0.12.0

@sheldonth
Copy link
Author

The offending code, in detail

keyPath = '/.bitpay/api.key' if not keyPath?
@encryptedPKey = (fs.readFileSync H + keyPath).toString()
@log.error "no bitpay private key present" if not @encryptedPKey?
@pKey = bitauth.decrypt '', @encryptedPKey
@client = bitpay.createClient @pKey

@bharathrao
Copy link

try:

keyPath = keyPath || '/.bitpay/api.key'

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

No branches or pull requests

2 participants