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

CarsonF opened this Issue Apr 8, 2016 · 4 comments


None yet
5 participants
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/", line 299, in getSecret
    plaintext = plaintext.decode("utf-8")
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xfe in position 0: invalid start byte



This comment has been minimized.

Copy link

alex-luminal commented Apr 11, 2016


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 :)


This comment has been minimized.

Copy link

vccabral commented Jun 2, 2016

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


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:
I didn't want to introduce any external dependencies to add this
support, but maybe there's a better option? I'm unsure.

This comment has been minimized.

Copy link

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.