jcoglan / vault-cipher

High-level authenticated encryption API used by Vault
Other
9 stars 1 forks source link

Could you release npm v0.4.0 #2

Open NewGyu opened 8 years ago

NewGyu commented 8 years ago

Hello! Your vault-cipher is very useful.

But it does not work with Node.js v4.2.6

> cipher = new Cipher("pass1")
{ _key: 'pass1',
  _work: 1000,
  _mode: 'aes-256-cbc',
  _mac: 'sha256',
  _format: 'base64',
  _salt: '73e69e8a-cb05-4b50-9f42-59d76a511299',
  _keySize: 16,
  _ivSize: 16,
  _macSize: 32 }
> cipher.encrypt(text)
undefined
> TypeError: Cannot read property 'call' of undefined
    at null.<anonymous> (/Users/newgyu/source/personalize/infra/cfn-template/secret-manage/node_modules/vault-cipher/lib/vault-cipher.js:70:13)
    at null.<anonymous> (/Users/newgyu/source/personalize/infra/cfn-template/secret-manage/node_modules/vault-cipher/lib/vault-cipher.js:42:16)
    at InternalFieldObject.ondone (/Users/newgyu/source/personalize/infra/cfn-template/secret-manage/node_modules/vault-cipher/lib/vault-cipher.js:5:14)

So, I hope that you will us to release v0.4.0.

jcoglan commented 8 years ago

I think the reason this error is happening is that you're not passing a callback. This line expects a callback to have been passed to encrypt().

jcoglan commented 8 years ago

(I assume this happened because the README on master shows you can use promises. Version 0.3 only supports callbacks, and that's what you should use.)

jcoglan commented 8 years ago

By the way, what are you using this library for? There are breaking changes in master that mean that ciphertexts produced with 0.3 will not decrypt under 0.4, whenever that's released.

It is also likely that the license will change from MIT to GPL.

NewGyu commented 8 years ago

I think the reason this error is happening is that you're not passing a callback. This line expects a callback to have been passed to encrypt().

Sorry, You're right. I was incorrectly read README.md on master branch.

By the way, what are you using this library for?

I am going to use "vault-cipher" for deployment script that I use.

NewGyu commented 8 years ago

I am happy when "promise" can be used.