Re: AES, ECB mode decrypt error

Arik Agazarian <[email protected]> Sat, 4 Nov 2023 19:20:13 +0100
Newsgroups gmane.comp.encryption.cryptopp
Message-ID <CAOLESw=Y7Zpiz=YZ_LX0AhaovXiOPQEti6f4jA1M4SXQ2J5YDg@mail.gmail.com>
--000000000000d2ee6a060957ac9e
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

We Need wallet address of 7 months for clean transactions, traceable on
Blockchain,
Ratio 45%/45%/10%
Sender/Reciever/Mandate
Telegram sender: @Arik_loader


On Thu, Nov 2, 2023, 7:21 PM Catherine Issabel <[email protected]>
wrote:

>
> $500 million dollars available only for good and trusted receiver or
> mandate
> Kindly contact the sender for more information:+1 (336) 345-9681
> On Friday, October 13, 2023 at 4:26:19=E2=80=AFAM UTC+1 Jeffrey Walton wr=
ote:
>
>> On Thu, Oct 12, 2023 at 5:55=E2=80=AFPM Dwight Kulkarni <dwi...@realtime=
-7.com>
>> wrote:
>> >
>> > Hello,
>> >
>> > I had Crypto PP code that was previously working and recently stopped
>> working. We moved to a new version of our BSP.
>> >
>> > Error is:
>> > terminate called after throwing an instance of
>> 'CryptoPP::AlgorithmParametersBase::ParameterNotUsed'
>> > what(): AlgorithmParametersBase: parameter "IV" not used
>> >
>> > Error is traced to this particular function below.
>> >
>> > I had it running with the Params in ECB mode still passing in the IV.
>> > d.SetKey(key, key.size(),params);
>> >
>> > Then I commented it out with:
>> > d.SetKey(key, key.size());
>> >
>> > Previously, it wasn't throwing an error even if IV is passed in ECB
>> mode.
>> >
>> > Also, I don't know why it's falling through the catch statement and
>> kills my program.
>> >
>> > should I have a generic catch statement Exception e to prevent this ?
>> >
>> > std::string decrypt_aes(std::string cipherbytes, SecByteBlock key,
>> SecByteBlock iv) {
>> > try {
>> > AlgorithmParameters params =3D MakeParameters(Name::FeedbackSize(),
>> 1/*8-bits*/)
>> > (Name::IV(), ConstByteArrayParameter(iv));
>> > //CFB_Mode<AES>::Decryption d;
>> > ECB_Mode<AES>::Decryption d;
>> > std::string recovered;
>> > //d.SetKey(key, key.size(),params);
>> > d.SetKey(key, key.size());
>> > StringSource s(cipherbytes, true, new StreamTransformationFilter(d, ne=
w
>> StringSink(recovered), CryptoPP::BlockPaddingSchemeDef::PKCS_PADDING));
>> > return recovered;
>> > }
>> > catch (CryptoPP::Exception e) {
>> > std::cerr << e.what() << std::endl;
>> > return "";
>> > }
>> > }
>>
>> BlockPaddingSchemeDef::PKCS_PADDING is incorrect for ECB mode. ECB
>> mode does not use padding. The programmer is responsible for padding
>> to block size.
>>
>> Jeff
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Crypto++ Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cryptopp-users/d2cee403-c881-4d42-a07b-=
caeacc5c87ffn%40googlegroups.com
> <https://groups.google.com/d/msgid/cryptopp-users/d2cee403-c881-4d42-a07b=
-caeacc5c87ffn%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>

--=20
You received this message because you are subscribed to the Google Groups "=
Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/=
cryptopp-users/CAOLESw%3DY7Zpiz%3DYZ_LX0AhaovXiOPQEti6f4jA1M4SXQ2J5YDg%40ma=
il.gmail.com.

--000000000000d2ee6a060957ac9e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div dir=3D"auto">We Need wallet address of 7 months for =
clean transactions, traceable on Blockchain,=C2=A0</div><div dir=3D"auto">R=
atio 45%/45%/10%</div><div dir=3D"auto">Sender/Reciever/Mandate</div><div d=
ir=3D"auto">Telegram sender: @Arik_loader</div><div dir=3D"auto"><br></div>=
</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">=
On Thu, Nov 2, 2023, 7:21 PM Catherine Issabel &lt;<a href=3D"mailto:issabe=
[email protected]">[email protected]</a>&gt; wrote:<br></div><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex"><br>$500 million dollars available only for go=
od and trusted receiver or mandate <br>Kindly contact the sender for more i=
nformation:+1 (336) 345-9681<br><div class=3D"gmail_quote"><div dir=3D"auto=
" class=3D"gmail_attr">On Friday, October 13, 2023 at 4:26:19=E2=80=AFAM UT=
C+1 Jeffrey Walton wrote:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:=
1ex">On Thu, Oct 12, 2023 at 5:55=E2=80=AFPM Dwight Kulkarni &lt;<a rel=3D"=
nofollow noreferrer">[email protected]</a>&gt; wrote:
<br>&gt;
<br>&gt; Hello,
<br>&gt;
<br>&gt; I had Crypto PP code that was previously working and recently stop=
ped working. We moved to a new version of our BSP.
<br>&gt;
<br>&gt; Error is:
<br>&gt; terminate called after throwing an instance of &#39;CryptoPP::Algo=
rithmParametersBase::ParameterNotUsed&#39;
<br>&gt;   what():  AlgorithmParametersBase: parameter &quot;IV&quot; not u=
sed
<br>&gt;
<br>&gt; Error is traced to this particular function below.
<br>&gt;
<br>&gt; I had it running with the Params in ECB mode still passing in the =
IV.
<br>&gt; d.SetKey(key, key.size(),params);
<br>&gt;
<br>&gt; Then I commented it out with:
<br>&gt; d.SetKey(key, key.size());
<br>&gt;
<br>&gt; Previously, it wasn&#39;t throwing an error even if IV is passed i=
n ECB mode.
<br>&gt;
<br>&gt; Also, I don&#39;t know why it&#39;s falling through the catch stat=
ement and kills my program.
<br>&gt;
<br>&gt; should I have a generic catch statement Exception e  to prevent th=
is ?
<br>&gt;
<br>&gt; std::string decrypt_aes(std::string cipherbytes, SecByteBlock key,=
 SecByteBlock iv) {
<br>&gt; try {
<br>&gt; AlgorithmParameters params =3D MakeParameters(Name::FeedbackSize()=
, 1/*8-bits*/)
<br>&gt; (Name::IV(), ConstByteArrayParameter(iv));
<br>&gt; //CFB_Mode&lt;AES&gt;::Decryption d;
<br>&gt; ECB_Mode&lt;AES&gt;::Decryption d;
<br>&gt; std::string recovered;
<br>&gt; //d.SetKey(key, key.size(),params);
<br>&gt; d.SetKey(key, key.size());
<br>&gt; StringSource s(cipherbytes, true, new StreamTransformationFilter(d=
, new StringSink(recovered), CryptoPP::BlockPaddingSchemeDef::PKCS_PADDING)=
);
<br>&gt; return recovered;
<br>&gt; }
<br>&gt; catch (CryptoPP::Exception e) {
<br>&gt; std::cerr &lt;&lt; e.what() &lt;&lt; std::endl;
<br>&gt; return &quot;&quot;;
<br>&gt; }
<br>&gt; }
<br>
<br>BlockPaddingSchemeDef::PKCS_PADDING is incorrect for ECB mode. ECB
<br>mode does not use padding. The programmer is responsible for padding
<br>to block size.
<br>
<br>Jeff
<br></blockquote></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;Crypto++ Users&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]" targ=
et=3D"_blank" rel=3D"noreferrer">[email protected]=
m</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/cryptopp-users/d2cee403-c881-4d42-a07b-caeacc5c87ffn%40googlegro=
ups.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" rel=
=3D"noreferrer">https://groups.google.com/d/msgid/cryptopp-users/d2cee403-c=
881-4d42-a07b-caeacc5c87ffn%40googlegroups.com</a>.<br>
</blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;Crypto++ Users&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:[email protected]">cryp=
[email protected]</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/cryptopp-users/CAOLESw%3DY7Zpiz%3DYZ_LX0AhaovXiOPQEti6f4jA1M4SXQ=
2J5YDg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://gro=
ups.google.com/d/msgid/cryptopp-users/CAOLESw%3DY7Zpiz%3DYZ_LX0AhaovXiOPQEt=
i6f4jA1M4SXQ2J5YDg%40mail.gmail.com</a>.<br />

--000000000000d2ee6a060957ac9e--