<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.fr.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>29 Jul 2019 14:45:39 Z</lastBuildDate><pubDate>14 Jul 2019 17:25:37 Z</pubDate><description>Bonjour a tous,&#13;
Je suis coincé avec la fonction crypteStandard et avec une api qui décrypte avec openssl_decrypt&#13;
&#13;
coté Windev dans l'expression la plus simple:&#13;
[code:wl]&#13;
"{ "compteID":40 }" // chaine de test&#13;
bufConsumer est un Buffer = "6B343EE61E4391F6B3D2D701B5723B0D50A981E085A3B416CF7AD09A8049BF73";&#13;
bufValeur est un Buffer = ChaîneVersUTF8(cValeur)&#13;
chaineCrypte est un Buffer = CrypteStandard(bufValeur, bufConsumer[[À 32]], crypteAES256,crypteCBC,cryptePaddingZéro)&#13;
&#13;
RENVOYER Encode(chaineCrypte,encodeBASE64)&#13;
[/code]&#13;
&#13;
Coté php toujours dans l’expression la plus simple:&#13;
[code:text]&#13;
$data = base64_decode($request-&gt;get('data'));&#13;
&#13;
    $consumer = '6B343EE61E4391F6B3D2D701B5723B0D50A981E085A3B416CF7AD09A8049BF73';&#13;
    $IV = substr($data,0 , $iv_size);&#13;
    $data = substr($data, $iv_size);&#13;
    $chaine = openssl_decrypt($data,'AES-256-CBC', substr($consumer, 0, 32), OPENSSL_RAW_DATA|OPENSSL_ZERO_PADDING, $IV);&#13;
[/code] &#13;
&#13;
Mon résultat de décodage est plutôt surprenant:&#13;
[code:text]&#13;
[2019-07-14 16:47:23] local.DEBUG: array (&#13;
  'data' =&gt; 'DCglypTepxa2cLtbSDWe543072lU6qZ5NRT4WtCYVySO07Kr',&#13;
  'IV' =&gt; 'KDWuAm20W+SZHV5s',&#13;
  'decrypter' =&gt; '1����-#.���d�`i�C�N����L\'�����V�P��}G�q&#13;
�(',&#13;
  'error' =&gt; false,&#13;
)  &#13;
[/code]&#13;
&#13;
j'effectue les mêmes test coté .net avec le même mode cryptage AES-256-CBC et cela fonctionne.&#13;
Je pense que coté Windev je dois certainement oublié une conversion de type avant mon appel.&#13;
&#13;
Merci pour votre aide</description><ttl>30</ttl><generator>WEBDEV</generator><language>fr_FR</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php/read.awp</link><title>crypteStandart et openssl php &gt;= 7</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster><item><author>The beginner</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231873/read.awp</comments><pubDate>29 Jul 2019 14:45:39 Z</pubDate><description>Bonjour,&#13;
je fais un retour final de la mise en place:&#13;
Nous utilisons Windev 24 et une api Rest distribué sous laravel avec php…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231873/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231873/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php/read.awp">crypteStandart et openssl php &gt;= 7</source><title>Re: crypteStandart et openssl php &gt;= 7</title></item><item><author>Philippe SB</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231637/read.awp</comments><pubDate>17 Jul 2019 08:27:21 Z</pubDate><description>Une chose que je peux dire c'est que encode renvoie des données avec des RC au bout d'un certain nombre de caractères. Es-tu sûr…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231637/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231637/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php/read.awp">crypteStandart et openssl php &gt;= 7</source><title>Re: crypteStandart et openssl php &gt;= 7</title></item><item><author>The beginner</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231558/read.awp</comments><pubDate>15 Jul 2019 10:19:35 Z</pubDate><description>Bonjour Philippe,&#13;
&#13;
Merci pour ta réponse&#13;
La conversion en UTF-8 ne change malheureusement rien.</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231558/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231558/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php/read.awp">crypteStandart et openssl php &gt;= 7</source><title>Re: crypteStandart et openssl php &gt;= 7</title></item><item><author>Philippe SB</author><category>pcsoft.fr.windev</category><comments>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231551/read.awp</comments><pubDate>15 Jul 2019 08:58:30 Z</pubDate><description>Bonjour,&#13;
&#13;
Il me semble que tu oublies de convertir le buffer "bufConsumer" en utf8.&#13;
&#13;
--&#13;
Cordialement,&#13;
&#13;
Philippe SAINT-BER…</description><guid isPermaLink="true">https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231551/read.awp</guid><link>https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php-231551/read.awp</link><source url="https://forum.pcsoft.fr/es-ES/pcsoft.fr.windev/231548-cryptestandart-openssl-php/read.awp">crypteStandart et openssl php &gt;= 7</source><title>Re: crypteStandart et openssl php &gt;= 7</title></item></channel></rss>
