Create encrypted data bag items using API REST

Hi all,

I am currently at the point of creating encrypted data bag items using the API Rest endpoint:
PUT /organizations/{organization}/data/{data_bag}/{data_bag_item}

I am doing the encryptation at the client side and sending an object with the encrypted databagitem to the above endpoint, as follows:

id: mydataitem2
cipher: aes-256-cbc
encrypted_data: R1KtoKeigpBwWycVUgYllx8mkfjOMH4cq0Jt3iGNaTU=
iv: nZb6Edu2kMZRVa062+YMcg==
version: 1

However, it gets saved in Chef as plain text. When accessing the databagitem from Knife, it says “WARNING: Unencrypted data bag detected, ignoring any provided secret options.”, so there is no way around to get data unencrypted from the recipes.

I have been shuffling all around the available documentacion but I had no luck to find anyone doing a similar task. Is there anyone who managed to do this at all? What implementation of OpenSSL have used? I am coding using C#.

Many thanks in advance.