Re: [cryptopp-users] Crypto++ Convert Integer to Unsigned Char

2023-04-24 Thread Jeffrey Walton
On Mon, Apr 24, 2023 at 11:55 AM Dwight Kulkarni wrote: > > Thank you for this, I just figured it out also with slightly different code. > > Here is my version. The issue was that I was converting it to vector char> and there was a bug in the conversion which was hard to debug because > every

Re: [cryptopp-users] Crypto++ Convert Integer to Unsigned Char

2023-04-24 Thread Dwight Kulkarni
Hi, Thank you for this, I just figured it out also with slightly different code. Here is my version. The issue was that I was converting it to vector and there was a bug in the conversion which was hard to debug because every time the message is changing. std::string

Re: [cryptopp-users] Crypto++ Convert Integer to Unsigned Char

2023-04-24 Thread One Sini
Hello my friend! I think that maybe my code can help. in cpp and python. Sincerely, Satoshi Nakamoto Cpp Code #include #include #include #include #include #include #include #include using namespace CryptoPP; std::string rsa_encrypt(const std::string& message, const RSA::PublicKey&

Re: [cryptopp-users] Crypto++ Convert Integer to Unsigned Char

2023-04-24 Thread Dwight Kulkarni
Hi Jeffery, I tried out your code and it works to generate the exact same encrypted message as Python if I use the Integer approach then change it to bytes. To make messages comparable, I used the _pad_for_signing code (see below) to generate exactly the same header. For Pcks1 v 1.5 it is

Re: [cryptopp-users] Crypto++ Convert Integer to Unsigned Char

2023-04-21 Thread Jeffrey Walton
On Fri, Apr 21, 2023 at 7:39 PM Dwight Kulkarni wrote: > > I need to convert Integer to unsigned char array or to vector > > If I do this: > for(int i=0; i cout << int(c.GetByte(i)) << " "; > } > > The values are not what I expect. Also, is there anything faster than a for > loop to get the

[cryptopp-users] Crypto++ Convert Integer to Unsigned Char

2023-04-21 Thread Dwight Kulkarni
Hi everyone, I need to convert Integer to unsigned char array or to vector If I do this: for(int i=0; ihttps://groups.google.com/d/msgid/cryptopp-users/c0f8e502-f976-4c14-adf3-3556a41eca93n%40googlegroups.com.