[cryptopp-users] AES, ECB mode decrypt error

2023-10-12 Thread Dwight Kulkarni
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 = MakeParameters(Name::FeedbackSize(), 1
/*8-bits*/)
(Name::IV(), ConstByteArrayParameter(iv));
//CFB_Mode::Decryption d;
ECB_Mode::Decryption d;
std::string recovered;
//d.SetKey(key, key.size(),params);
d.SetKey(key, key.size());
StringSource s(cipherbytes, true, new StreamTransformationFilter(d, new 
StringSink(recovered), CryptoPP::BlockPaddingSchemeDef::PKCS_PADDING));
return recovered;
}
catch (CryptoPP::Exception e) {
std::cerr << e.what() << std::endl;
return "";
}
} 

-- 
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 cryptopp-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cryptopp-users/c1d3f2e2-46d1-425a-b20a-e189e7b6d41en%40googlegroups.com.


Re: [cryptopp-users] AES, ECB mode decrypt error

2023-10-12 Thread Jeffrey Walton
On Thu, Oct 12, 2023 at 5:55 PM Dwight Kulkarni  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 = MakeParameters(Name::FeedbackSize(), 1/*8-bits*/)
> (Name::IV(), ConstByteArrayParameter(iv));
> //CFB_Mode::Decryption d;
> ECB_Mode::Decryption d;
> std::string recovered;
> //d.SetKey(key, key.size(),params);
> d.SetKey(key, key.size());
> StringSource s(cipherbytes, true, new StreamTransformationFilter(d, new 
> 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 cryptopp-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cryptopp-users/CAH8yC8mEuBX99%2BpYiKgSwMVDvRL%3DBct9K%2BpQjCt-%2Be2Mrhc5DA%40mail.gmail.com.


Re: [cryptopp-users] AES, ECB mode decrypt error

2023-10-16 Thread Arik Agazarian
We are looking for Genuine Recipients of Bitcoin Deals: We still have Over
$100M Worth Bitcoins now ready to be processed: First Trial :$5m Note: We
can start small (Amount: $1,000,000 is the least) Don't message me if
you're not ready Ratio is 45/45/10 Bitcoin is clean and spendable 100% (
traceable on blockchain network) Are you interested? Telegram sender:
@Arik_loader


On Thu, Oct 12, 2023, 10:55 PM Dwight Kulkarni 
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 = MakeParameters(Name::FeedbackSize(), 1
> /*8-bits*/)
> (Name::IV(), ConstByteArrayParameter(iv));
> //CFB_Mode::Decryption d;
> ECB_Mode::Decryption d;
> std::string recovered;
> //d.SetKey(key, key.size(),params);
> d.SetKey(key, key.size());
> StringSource s(cipherbytes, true, new StreamTransformationFilter(d, new
> StringSink(recovered), CryptoPP::BlockPaddingSchemeDef::PKCS_PADDING));
> return recovered;
> }
> catch (CryptoPP::Exception e) {
> std::cerr << e.what() << std::endl;
> return "";
> }
> }
>
> --
> 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 cryptopp-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cryptopp-users/c1d3f2e2-46d1-425a-b20a-e189e7b6d41en%40googlegroups.com
> 
> .
>

-- 
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 cryptopp-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cryptopp-users/CAOLESwkdoM5%3D%3DWadKBwinSmgSP8mLVKWTxA2w36-D5e2qu_vZA%40mail.gmail.com.


Re: [cryptopp-users] AES, ECB mode decrypt error

2023-11-02 Thread Catherine Issabel

$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 AM UTC+1 Jeffrey Walton wrote:

> On Thu, Oct 12, 2023 at 5:55 PM Dwight Kulkarni  
> 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 = MakeParameters(Name::FeedbackSize(), 
> 1/*8-bits*/)
> > (Name::IV(), ConstByteArrayParameter(iv));
> > //CFB_Mode::Decryption d;
> > ECB_Mode::Decryption d;
> > std::string recovered;
> > //d.SetKey(key, key.size(),params);
> > d.SetKey(key, key.size());
> > StringSource s(cipherbytes, true, new StreamTransformationFilter(d, new 
> 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 cryptopp-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cryptopp-users/d2cee403-c881-4d42-a07b-caeacc5c87ffn%40googlegroups.com.


Re: [cryptopp-users] AES, ECB mode decrypt error

2023-11-04 Thread Arik Agazarian
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 
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 AM UTC+1 Jeffrey Walton wrote:
>
>> On Thu, Oct 12, 2023 at 5:55 PM Dwight Kulkarni 
>> 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 = MakeParameters(Name::FeedbackSize(),
>> 1/*8-bits*/)
>> > (Name::IV(), ConstByteArrayParameter(iv));
>> > //CFB_Mode::Decryption d;
>> > ECB_Mode::Decryption d;
>> > std::string recovered;
>> > //d.SetKey(key, key.size(),params);
>> > d.SetKey(key, key.size());
>> > StringSource s(cipherbytes, true, new StreamTransformationFilter(d, new
>> 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 cryptopp-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/cryptopp-users/d2cee403-c881-4d42-a07b-caeacc5c87ffn%40googlegroups.com
> 
> .
>

-- 
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 cryptopp-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/cryptopp-users/CAOLESw%3DY7Zpiz%3DYZ_LX0AhaovXiOPQEti6f4jA1M4SXQ2J5YDg%40mail.gmail.com.