# Trouble with encrypted data bag

**URL:** https://discourse.chef.io/t/trouble-with-encrypted-data-bag/2574
**Category:** Chef Infra (archive)
**Created:** [March 2, 2012, 9:54pm UTC](https://discourse.chef.io/t/trouble-with-encrypted-data-bag/2574 "2012-03-02T21:54:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Steve\_Ivy](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/steve_ivy/32/750_2.png) [@Steve\_Ivy](https://discourse.chef.io/u/Steve_Ivy)
#### Post date: [March 2, 2012, 9:54pm UTC](https://discourse.chef.io/t/trouble-with-encrypted-data-bag/2574/1 "2012-03-02T21:54:07Z")

</div>

Hey all,

I’m trying to get my ssl certs deployed to my new server via encrypted  
data bags, largely following jtimberman’s blog post here:

```
http://jtimberman.posterous.com/64227128

```

I created the encrypted\_data\_bag\_secret file according to his example,  
and stored it in ~/.chef/encrypted\_data\_bag\_secret. I then created the  
data bag using that secret.

After creating the data bag and an item (in my case, ssl\_certs) I  
modified the item to include the json struct with my ssl cert data.  
When using knife edit or show, the data is unencrypted as expected.

I then copied the encrypted\_data\_bag\_secret to /etc/chef/ on my Vagrant VM.

When I went to actually push the files to my VM (via vagrant provision  
appserver), I got a “bad decrypt” error. The gist:

```
https://gist.github.com/8e4f5e2a2c2909fdbf49

```

I’ve confirmed that the files are the same in both locations. Any  
thoughts on fixing this?

Thanks,

–Steve

–  
Steve Ivy // [steve@wallrazer.com](mailto:steve@wallrazer.com)  
Wallrazer, Inc.
