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 <<a href=3D"mailto:issabe= [email protected]">[email protected]</a>> 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 <<a rel=3D"= nofollow noreferrer">[email protected]</a>> wrote: <br>> <br>> Hello, <br>> <br>> I had Crypto PP code that was previously working and recently stop= ped working. We moved to a new version of our BSP. <br>> <br>> Error is: <br>> terminate called after throwing an instance of 'CryptoPP::Algo= rithmParametersBase::ParameterNotUsed' <br>> what(): AlgorithmParametersBase: parameter "IV" not u= sed <br>> <br>> Error is traced to this particular function below. <br>> <br>> I had it running with the Params in ECB mode still passing in the = IV. <br>> d.SetKey(key, key.size(),params); <br>> <br>> Then I commented it out with: <br>> d.SetKey(key, key.size()); <br>> <br>> Previously, it wasn't throwing an error even if IV is passed i= n ECB mode. <br>> <br>> Also, I don't know why it's falling through the catch stat= ement and kills my program. <br>> <br>> should I have a generic catch statement Exception e to prevent th= is ? <br>> <br>> std::string decrypt_aes(std::string cipherbytes, SecByteBlock key,= SecByteBlock iv) { <br>> try { <br>> AlgorithmParameters params =3D MakeParameters(Name::FeedbackSize()= , 1/*8-bits*/) <br>> (Name::IV(), ConstByteArrayParameter(iv)); <br>> //CFB_Mode<AES>::Decryption d; <br>> ECB_Mode<AES>::Decryption d; <br>> std::string recovered; <br>> //d.SetKey(key, key.size(),params); <br>> d.SetKey(key, key.size()); <br>> StringSource s(cipherbytes, true, new StreamTransformationFilter(d= , new StringSink(recovered), CryptoPP::BlockPaddingSchemeDef::PKCS_PADDING)= ); <br>> return recovered; <br>> } <br>> catch (CryptoPP::Exception e) { <br>> std::cerr << e.what() << std::endl; <br>> return ""; <br>> } <br>> } <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" 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&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" 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--