# About Decryption in Amazon Music

**URL:** <https://community.amazondeveloper.com/t/about-decryption-in-amazon-music/2693>\
**Category:** Amazon Music\
**Created:** [February 6, 2024, 7:18am UTC](https://community.amazondeveloper.com/t/about-decryption-in-amazon-music/2693 "2024-02-06T07:18:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephen\_Kwan](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Stephen\_Kwan](https://community.amazondeveloper.com/u/Stephen_Kwan)\
**Post date:** [February 6, 2024, 7:18am UTC](https://community.amazondeveloper.com/t/about-decryption-in-amazon-music/2693/1 "2024-02-06T07:18:03Z")

</div>

We are creating Amazon Music streaming application in Yocto project. We are able to have License Response from the License server, and download the audio segments. But we don’t know how to decrypt the audio segments. Is there any sample source code for reference?

Thanks!

---

<div class="post-metadata">

**Author:** ![sam](https://dhm3gbtzu79o6.cloudfront.net/user_avatar/community.amazondeveloper.com/sam/32/597_2.png) [@sam](https://community.amazondeveloper.com/u/sam)\
**Post date:** [February 19, 2024, 8:45pm UTC](https://community.amazondeveloper.com/t/about-decryption-in-amazon-music/2693/2 "2024-02-19T20:45:43Z")

</div>

Amazon Music uses Widevine for DRM Encryption.

> **[Widevine | Widevine](https://www.widevine.com/)**
>
> Widevine provides multiplatform DRM and video optimization solutions using industry adopted standards including common encryption (CENC) and encrypted media extensions (EME).

---

<div class="post-metadata">

**Author:** ![Stephen\_Kwan](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Stephen\_Kwan](https://community.amazondeveloper.com/u/Stephen_Kwan)\
**Post date:** [February 20, 2024, 6:31am UTC](https://community.amazondeveloper.com/t/about-decryption-in-amazon-music/2693/3 "2024-02-20T06:31:06Z")

</div>

Hi Sam,

Thanks. We have Widevine SDK from Google. But we don’t know which APIs can be used to decrypt the audio segments of Amazon Music file.  
Is there any reference source code specific for Amazon Music decryption?  
We did ask for support from Widevine. They told us to ask Amazon Music for the implementation of the decryption.

---

<div class="post-metadata">

**Author:** ![sam](https://dhm3gbtzu79o6.cloudfront.net/user_avatar/community.amazondeveloper.com/sam/32/597_2.png) [@sam](https://community.amazondeveloper.com/u/sam)\
**Post date:** [February 20, 2024, 5:44pm UTC](https://community.amazondeveloper.com/t/about-decryption-in-amazon-music/2693/4 "2024-02-20T17:44:54Z")

</div>

Let me know if this helps. If not can you provide specifics of what trouble you are running into? The Widevine CDM should decrypt the media segments for you.

> **[Playback & DRM Overview | Amazon Music Playback](https://developer.amazon.com/docs/music/playback_overview.html)**
>
> OverviewThis document is intended for developers who are integrating their devices with Amazon Music via the Amazon Music Device API.When a user taps PLAY on their device or app...

---

<div class="post-metadata">

**Author:** ![Stephen\_Kwan](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Stephen\_Kwan](https://community.amazondeveloper.com/u/Stephen_Kwan)\
**Post date:** [February 21, 2024, 8:04am UTC](https://community.amazondeveloper.com/t/about-decryption-in-amazon-music/2693/5 "2024-02-21T08:04:04Z")

</div>

![playback_overview_1_workflow.TTH](https://d3mq594dkmpl37.cloudfront.net/original/1X/ffbdaf2bf5931e5a2f8cb78f0f8ca50aa7ad0633.png)

We followed the Playback workflow as the above picture. In step 10, we called “Status update(const std::string& session\_id, const std::string& response)” from Widevine CDM to update the license. In step 12, we supposed to call “Status decrypt(const std::string& session\_id, const InputBuffer& input, const OutputBuffer& output)” from Widevine CDM. But the struct of InputBuffer contains key\_id and iv which we don’t know how to parse from the license response.

Can you please help?

---

<div class="post-metadata">

**Author:** ![Edy](https://dhm3gbtzu79o6.cloudfront.net/user_avatar/community.amazondeveloper.com/edy/32/596_2.png) [@Edy](https://community.amazondeveloper.com/u/Edy)\
**Post date:** [February 22, 2024, 11:32pm UTC](https://community.amazondeveloper.com/t/about-decryption-in-amazon-music/2693/6 "2024-02-22T23:32:35Z")

</div>

Those fields are found directly from the stream.  
In general, media extractor libraries you may use to parse the streams will parse this info and expose it to you.  
If your platform allows the app to handle parsing and extraction of the streams, then you will need to add fields to your API to allow the app to specify these values.

---

<div class="post-metadata">

**Author:** ![Stephen\_Kwan](https://avatars.discourse-cdn.com/v4/letter/s/ebca7d/32.png) [@Stephen\_Kwan](https://community.amazondeveloper.com/u/Stephen_Kwan)\
**Post date:** [February 27, 2024, 6:20am UTC](https://community.amazondeveloper.com/t/about-decryption-in-amazon-music/2693/7 "2024-02-27T06:20:25Z")

</div>

Thanks for your reply.  
Can you suggest some “media extractor libraries” to parse the Amazon Music streams?

---

<div class="post-metadata">

**Author:** ![Edy](https://dhm3gbtzu79o6.cloudfront.net/user_avatar/community.amazondeveloper.com/edy/32/596_2.png) [@Edy](https://community.amazondeveloper.com/u/Edy)\
**Post date:** [March 11, 2024, 7:28pm UTC](https://community.amazondeveloper.com/t/about-decryption-in-amazon-music/2693/8 "2024-03-11T19:28:56Z")

</div>

I suggest you look for Open Source projects like in the following link [Top 7 widevine Open-Source Projects (Jan 2024)](https://www.libhunt.com/topic/widevine)  
Disclaimer, suggested open source projects are not recommended or supported by Amazon
