Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

I'm trying to encrypt and dash an MP4 file (https://www.mediafire.com/file/z92dwuhpwxsdf9c/bbb_avc_aac.mp4/file) using the command `gpac -i bbb_avc_aac.mp4 cecrypt:cfile=crypt.xml -o bbb.mpd:dual:stl:profile=live:pssh=mv` along with the crypt file:
```
<?xml version="1.0" encoding="UTF-8" ?>
<GPACDRM type="CENC AES-CTR">
  <!-- Widevine -->
  <DRMInfo type="pssh" version="0">
    <BS ID128="EDEF8BA979D64ACEA3C827DCD51D21ED"/>
    <BS data64="AAAAP3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAB8SEAjof0FSQkzUsovUwKSE8+EaBWV6ZHJtSOPclZsG"/>
  </DRMInfo>

  <CrypTrack IsEncrypted="1" IV_size="8" first_IV="0x22ee7d4745d3a26a" saiSavedBox="senc">
    <key KID="0x08e87f4152424cd4b28bd4c0a484f3e1" value="0x8704aeedecd6aae0413e3d53d2d1f60e"/>
  </CrypTrack>
</GPACDRM>
```

I've got this PSSH from my DRM provider, EZDRM. It has a length of 63 bytes and can be correctly parsed by https://tools.axinom.com/decoders/PsshBox. However, the resulting MPD file has a different value for it:
```
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 2.1-DEV-rev429-g6f4ed0c29-master at 2022-10-31T17:46:45.871Z -->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.000S" type="static" mediaPresentationDuration="PT0H1M0.232S" maxSegmentDuration="PT0H0M8.334S" profiles="urn:mpeg:dash:profile:isoff-live:2011" xmlns:cenc="urn:mpeg:cenc:2013">
 <ProgramInformation moreInformationURL="http://gpac.io">
  <Title>bbb.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period duration="PT0H1M0.232S">
  <AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="30" par="16:9" lang="und" startWithSAP="1">
   <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="08e87f41-5242-4cd4-b28b-d4c0a484f3e1"/>
   <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" value="Widevine">
    <cenc:pssh>AAAAX3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAD8AAAA/cHNzaAAAAADt74upedZKzqPIJ9zVHSHtAAAAHxIQCOh/QVJCTNSyi9TApITz4RoFZXpkcm1I49yVmwY=</cenc:pssh>
   </ContentProtection>
   <SegmentTemplate media="bbb_avc_aac_dash_track1_$Time$.m4s" initialization="bbb_avc_aac_dash_track1_init.mp4" timescale="30000" presentationTimeOffset="1980" startNumber="1">
    <SegmentTimeline>
     <S t="3960" d="250000"/>
     <S d="237000"/>
     <S d="116000"/>
     <S d="219000"/>
     <S d="250000"/>
     <S d="119000"/>
     <S d="250000"/>
     <S d="121000"/>
     <S d="243000"/>
    </SegmentTimeline>
   </SegmentTemplate>
   <Representation id="1" mimeType="video/mp4" codecs="avc1.640029" width="1920" height="1080" frameRate="30" sar="1:1" bandwidth="3084144">
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" lang="und" startWithSAP="1">
   <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="08e87f41-5242-4cd4-b28b-d4c0a484f3e1"/>
   <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" value="Widevine">
    <cenc:pssh>AAAAX3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAD8AAAA/cHNzaAAAAADt74upedZKzqPIJ9zVHSHtAAAAHxIQCOh/QVJCTNSyi9TApITz4RoFZXpkcm1I49yVmwY=</cenc:pssh>
   </ContentProtection>
   <SegmentTemplate media="bbb_avc_aac_dash_track2_$Time$.m4s" initialization="bbb_avc_aac_dash_track2_init.mp4" timescale="48000" startNumber="1">
    <SegmentTimeline>
     <S t="0" d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="1"/>
     <S d="48640"/>
    </SegmentTimeline>
   </SegmentTemplate>
   <Representation id="2" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" bandwidth="384110">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="6"/>
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>
```

This value, `AAAAX3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAD8AAAA/cHNzaAAAAADt74upedZKzqPIJ9zVHSHtAAAAHxIQCOh/QVJCTNSyi9TApITz4RoFZXpkcm1I49yVmwY=`, is 32 bytes longer. Trying to decode it on https://tools.axinom.com/decoders/PsshBox gives an error. Looking at the hexadecimal version I can clearly tell that the start and end of the values are similar, but something is added in the middle.

My main problem is that the DRM provider's servers respond with an `500 Internal server error` when I try to retrieve the license for playback (using e.g. Google Chrome along with `video.js`). I can fix this error by manually replacing the longer PSSH values in the MPD file with the one from the input crypt file. But I'd rather know if I'm doing something wrong while encrypting and dashing my content. Is there a way that I can tell GPAC to copy the PSSH value exactly, instead of rewriting it?

For completeness: I'm running GPAC on macOS with the latest version `2.1-DEV-rev429-g6f4ed0c29-master` installed using `brew install gpac --HEAD`, but I encountered the same problem when trying the older `1.0.1` release.
Widevine PSSH in MPD is 32 bytes longer than provided in crypt file
This is a GitHub Issue
repo:gpac
owner:gpac
Title : Widevine PSSH in MPD is 32 bytes longer than provided in crypt file
Issue date:

--- start body ---
Thanks for reporting your issue. Please make sure these boxes are checked before submitting your issue - thank you!

- [x] I looked for a similar issue and couldn't find any.
- [x] I tried with the latest version of GPAC. Installers available at http://gpac.io/downloads/gpac-nightly-builds/
- [x] I give enough information for contributors to reproduce my issue (meaningful title, github labels, platform and compiler, command-line ...). I can share files anonymously with this dropbox: https://www.mediafire.com/filedrop/filedrop_hosted.php?drop=eec9e058a9486fe4e99c33021481d9e1826ca9dbc242a6cfaab0fe95da5e5d95

Detailed guidelines: http://gpac.io/2013/07/16/how-to-file-a-bug-properly/

I'm trying to encrypt and dash an MP4 file (https://www.mediafire.com/file/z92dwuhpwxsdf9c/bbb_avc_aac.mp4/file) using the command `gpac -i bbb_avc_aac.mp4 cecrypt:cfile=crypt.xml -o bbb.mpd:dual:stl:profile=live:pssh=mv` along with the crypt file:
```
<?xml version="1.0" encoding="UTF-8" ?>
<GPACDRM type="CENC AES-CTR">
  <!-- Widevine -->
  <DRMInfo type="pssh" version="0">
    <BS ID128="EDEF8BA979D64ACEA3C827DCD51D21ED"/>
    <BS data64="AAAAP3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAB8SEAjof0FSQkzUsovUwKSE8+EaBWV6ZHJtSOPclZsG"/>
  </DRMInfo>

  <CrypTrack IsEncrypted="1" IV_size="8" first_IV="0x22ee7d4745d3a26a" saiSavedBox="senc">
    <key KID="0x08e87f4152424cd4b28bd4c0a484f3e1" value="0x8704aeedecd6aae0413e3d53d2d1f60e"/>
  </CrypTrack>
</GPACDRM>
```

I've got this PSSH from my DRM provider, EZDRM. It has a length of 63 bytes and can be correctly parsed by https://tools.axinom.com/decoders/PsshBox. However, the resulting MPD file has a different value for it:
```
<?xml version="1.0"?>
<!-- MPD file Generated with GPAC version 2.1-DEV-rev429-g6f4ed0c29-master at 2022-10-31T17:46:45.871Z -->
<MPD xmlns="urn:mpeg:dash:schema:mpd:2011" minBufferTime="PT1.000S" type="static" mediaPresentationDuration="PT0H1M0.232S" maxSegmentDuration="PT0H0M8.334S" profiles="urn:mpeg:dash:profile:isoff-live:2011" xmlns:cenc="urn:mpeg:cenc:2013">
 <ProgramInformation moreInformationURL="http://gpac.io">
  <Title>bbb.mpd generated by GPAC</Title>
 </ProgramInformation>

 <Period duration="PT0H1M0.232S">
  <AdaptationSet segmentAlignment="true" maxWidth="1920" maxHeight="1080" maxFrameRate="30" par="16:9" lang="und" startWithSAP="1">
   <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="08e87f41-5242-4cd4-b28b-d4c0a484f3e1"/>
   <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" value="Widevine">
    <cenc:pssh>AAAAX3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAD8AAAA/cHNzaAAAAADt74upedZKzqPIJ9zVHSHtAAAAHxIQCOh/QVJCTNSyi9TApITz4RoFZXpkcm1I49yVmwY=</cenc:pssh>
   </ContentProtection>
   <SegmentTemplate media="bbb_avc_aac_dash_track1_$Time$.m4s" initialization="bbb_avc_aac_dash_track1_init.mp4" timescale="30000" presentationTimeOffset="1980" startNumber="1">
    <SegmentTimeline>
     <S t="3960" d="250000"/>
     <S d="237000"/>
     <S d="116000"/>
     <S d="219000"/>
     <S d="250000"/>
     <S d="119000"/>
     <S d="250000"/>
     <S d="121000"/>
     <S d="243000"/>
    </SegmentTimeline>
   </SegmentTemplate>
   <Representation id="1" mimeType="video/mp4" codecs="avc1.640029" width="1920" height="1080" frameRate="30" sar="1:1" bandwidth="3084144">
   </Representation>
  </AdaptationSet>
  <AdaptationSet segmentAlignment="true" lang="und" startWithSAP="1">
   <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc" cenc:default_KID="08e87f41-5242-4cd4-b28b-d4c0a484f3e1"/>
   <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" value="Widevine">
    <cenc:pssh>AAAAX3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAD8AAAA/cHNzaAAAAADt74upedZKzqPIJ9zVHSHtAAAAHxIQCOh/QVJCTNSyi9TApITz4RoFZXpkcm1I49yVmwY=</cenc:pssh>
   </ContentProtection>
   <SegmentTemplate media="bbb_avc_aac_dash_track2_$Time$.m4s" initialization="bbb_avc_aac_dash_track2_init.mp4" timescale="48000" startNumber="1">
    <SegmentTimeline>
     <S t="0" d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="6"/>
     <S d="47104"/>
     <S d="48128" r="1"/>
     <S d="48640"/>
    </SegmentTimeline>
   </SegmentTemplate>
   <Representation id="2" mimeType="audio/mp4" codecs="mp4a.40.2" audioSamplingRate="48000" bandwidth="384110">
    <AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="6"/>
   </Representation>
  </AdaptationSet>
 </Period>
</MPD>
```

This value, `AAAAX3Bzc2gAAAAA7e+LqXnWSs6jyCfc1R0h7QAAAD8AAAA/cHNzaAAAAADt74upedZKzqPIJ9zVHSHtAAAAHxIQCOh/QVJCTNSyi9TApITz4RoFZXpkcm1I49yVmwY=`, is 32 bytes longer. Trying to decode it on https://tools.axinom.com/decoders/PsshBox gives an error. Looking at the hexadecimal version I can clearly tell that the start and end of the values are similar, but something is added in the middle.

My main problem is that the DRM provider's servers respond with an `500 Internal server error` when I try to retrieve the license for playback (using e.g. Google Chrome along with `video.js`). I can fix this error by manually replacing the longer PSSH values in the MPD file with the one from the input crypt file. But I'd rather know if I'm doing something wrong while encrypting and dashing my content. Is there a way that I can tell GPAC to copy the PSSH value exactly, instead of rewriting it?

For completeness: I'm running GPAC on macOS with the latest version `2.1-DEV-rev429-g6f4ed0c29-master` installed using `brew install gpac --HEAD`, but I encountered the same problem when trying the older `1.0.1` release.
--- end body ---

The issue reported indicates a discrepancy in the PSSH (Protection System Specific Header) data generated by GPAC during the encryption process. The PSSH value in the generated MPD file is 32 bytes longer than the original value provided in the crypt file, which leads to errors when attempting to retrieve licenses from the DRM provider. This could potentially indicate a bug in the GPAC implementation that alters the PSSH data, which may affect the integrity of the DRM process. However, it does not appear to be a direct security vulnerability, but rather a functional issue with the handling of DRM data.