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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Get/Put binary files #73

Closed
CarsonF opened this Issue Apr 8, 2016 · 4 comments

Comments

Projects
None yet
5 participants
@CarsonF
Copy link

CarsonF commented Apr 8, 2016

I'm trying to store a binary file, but I get this error when I try to put:

credstash put: error: argument value: invalid value_or_filename value: '@/Users/Carson/.keystore'

This works fine with a PHP port I've been working on... 馃榿

So if I put with PHP and try to get with Python I get this error:

  File "/usr/local/bin/credstash.py", line 299, in getSecret
    plaintext = plaintext.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 0: invalid start byte

Thoughts?

@alex-luminal

This comment has been minimized.

Copy link
Contributor

alex-luminal commented Apr 11, 2016

+1

I know of at least one person who worked around this by base64-encoding binaries that he was sticking in credstash, but that sucks. We should actually fix it. We could either store another attribute that the stored value is a binary and so not to decode it as utf-8, or do something smarter about encoding.

I'm traveling at the moment, and wont have time to get on this until I get back. If anyone wants to cut a PR in the meantime, it would be super appreciated :)

@vccabral

This comment has been minimized.

Copy link
Contributor

vccabral commented Jun 2, 2016

+1
I'd love to make a more significant contribution. I might need a bit of hand holding :(

@spallem

This comment has been minimized.

Copy link

spallem commented Aug 1, 2016

Also there seems to be a padding issue with the secret. The secret has to be length multiples of 16. Is there a flag to specify padding character?

nathan-muir added a commit to 3stack-software/credsmash that referenced this issue Sep 28, 2016

Cryptography - Add new `aes-ctr` mode that supports binary & uses ran鈥
鈥om nonces.

Fixes fugue#73 by no longer treating all values as unicode.

Fixes fugue#75 by generating & storing a unique nonce.

artburkart pushed a commit to artburkart/credstash that referenced this issue Oct 13, 2017

Arthur Burkart
Resolves fugue#73: Adds binary secret support
This is perhaps a superficial approach to supporting binary secrets. If
it's not satisfactory, I'd love to discuss what would be, so I can help
get that on the road. I shamelessly ripped the binary check function
from jfs of SO: https://stackoverflow.com/a/7392391/830495.
I didn't want to introduce any external dependencies to add this
support, but maybe there's a better option? I'm unsure.
@artburkart

This comment has been minimized.

Copy link
Contributor

artburkart commented Oct 13, 2017

I've opened a PR that may serve as an example of how this might be tackled? I'm unsure, would love to discuss further. Thanks!

alex-luminal added a commit that referenced this issue Oct 24, 2018

alex-luminal added a commit that referenced this issue Oct 24, 2018

Merge pull request #225 from fugue/revert-223-allow-binary-secrets
Revert "Resolves #73: Support binary secrets"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.