Re: Re: SonarLint complaining about "Use a stronger padding scheme"

One Sini <[email protected]> Wed, 24 Apr 2024 19:51:49 +0200
Newsgroups gmane.comp.encryption.cryptopp
Message-ID <CAJm61-AqjXEm-753YkgaD29QKQb61q3S+7_OHgkg3YX6D2ZWtQ@mail.gmail.com>
--000000000000d2e27b0616db53d8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Test this way

a basic guide on how to generate an RSA key pair with PSS padding, sign an
X509 certificate with the private key, and verify the signature with the
public key using the Crypto++ library:

   1. Generating an RSA Key Pair with PSS Padding:

cpp

Copy code

#include <cryptopp/rsa.h>

#include <cryptopp/osrng.h>

#include <cryptopp/pssr.h>


using namespace CryptoPP;


void generateRSAKeyPair(RSA::PrivateKey& privateKey, RSA::PublicKey&
publicKey) {

    AutoSeededRandomPool rng;


    InvertibleRSAFunction params;

    params.GenerateRandomWithKeySize(rng, 2048);


    privateKey =3D RSA::PrivateKey(params);

    publicKey =3D RSA::PublicKey(params);

}


int main() {

    RSA::PrivateKey privateKey;

    RSA::PublicKey publicKey;


    generateRSAKeyPair(privateKey, publicKey);


    // The RSA key pair has been generated and is now available

    return 0;

}

   1. Signing the X509 Certificate with the Private Key:

cpp


Copy code

#include <cryptopp/cryptlib.h>

#include <cryptopp/oids.h>

#include <cryptopp/rsa.h>

#include <cryptopp/sha.h>

#include <cryptopp/filters.h>

#include <cryptopp/base64.h>


using namespace CryptoPP;


void signCertificate(const RSA::PrivateKey& privateKey, const X509&
certificate, byte* signature) {

    // Implement the process of signing the certificate here

    // Use privateKey and certificate to sign the certificate

}


int main() {

    // Load or create your X509 certificate

    // Here, we assume you already have an X509 certificate


    RSA::PrivateKey privateKey;

    // Load or generate your private key

    // Here, we assume you already have a private key


    byte signature[256]; // Space for the signature


    signCertificate(privateKey, certificate, signature);


    // The certificate has been signed, and the signature is now available

    return 0;

}

   1. Verifying the Signature with the Public Key:

cpp


Copy code

#include <cryptopp/rsa.h>

#include <cryptopp/sha.h>

#include <cryptopp/filters.h>

#include <cryptopp/base64.h>


using namespace CryptoPP;


bool verifySignature(const RSA::PublicKey& publicKey, const X509&
certificate, const byte* signature) {

    // Implement the process of verifying the signature here

    // Use publicKey, certificate, and signature


    // Return true if the signature is valid, otherwise false

    return false;

}


int main() {

    // Load or create your X509 certificate

    // Here, we assume you already have an X509 certificate


    RSA::PublicKey publicKey;

    // Load or generate your public key

    // Here, we assume you already have a public key


    byte signature[256]; // Take the signature from the certificate
signature


    bool isValid =3D verifySignature(publicKey, certificate, signature);


    // Check if the signature is valid

    return 0;

}

These code snippets serve as a foundation. You will need to adapt them
according to your specific implementation, including the loading process
for the X509 certificate and the private/public keys. Remember to include
error handling and handle edge cases in your implementation
I hope this help you
;)

Manish sharma <[email protected]> schrieb am Mi. 24. Apr. 2024 um
14:42:

> Crypto Betting  <https://www.brsoftech.com/blog/crypto-sports-betting/>
>
> On Wed, Apr 24, 2024 at 6:08=E2=80=AFPM Frank Sapone <franksaponegea@gmai=
l.com>
> wrote:
>
>> Has anyone figured out how to use PSS and SHA256 *WITH *CryptoPP-PEM?  I
>> also tried reporting this to the issuer tracker at
>> https://github.com/noloader/cryptopp-pem and nobody has replied.  I
>> can't imagine I'm the only person using this library in order to achieve
>> this with X509 Certs.
>>
>> Thanks,
>> Frank
>>
>> On Wednesday, April 17, 2024 at 11:43:54=E2=80=AFAM UTC-4 HELA YAICH wro=
te:
>>
>>> Hello,
>>> (I'm new user of ns3 and crypto)
>>> I have link errors with Crypto++. These errors indicate that the
>>> compiler cannot find certain functions or classes defined in Crypto++. =
This
>>> can happen if Crypto++ is not correctly linked to my project. However, =
I
>>> tried to modify my project's CMakeLists.txt file as follows:
>>> set(target_prefix scratch_)
>>>
>>> function(create_scratch source_files)
>>>   # Return early if no sources in the subdirectory
>>>   list(LENGTH source_files number_sources)
>>>   if(number_sources EQUAL 0)
>>>     return()
>>>   endif()
>>>
>>>   # If the scratch has more than a source file, we need to find the
>>> source with
>>>   # the main function
>>>   set(scratch_src)
>>>   foreach(source_file ${source_files})
>>>     file(READ ${source_file} source_file_contents)
>>>     string(REGEX MATCHALL "main[(| (]" main_position
>>> "${source_file_contents}")
>>>     if(CMAKE_MATCH_0)
>>>       set(scratch_src ${source_file})
>>>     endif()
>>>   endforeach()
>>>
>>>   if(NOT scratch_src)
>>>     return()
>>>   endif()
>>>
>>>   # Get parent directory name
>>>   get_filename_component(scratch_dirname ${scratch_src} DIRECTORY)
>>>   string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}" "" scratch_dirname
>>>                  "${scratch_dirname}"
>>>   )
>>>   string(REPLACE "/" "_" scratch_dirname "${scratch_dirname}")
>>>
>>>   # Get source name
>>>   get_filename_component(scratch_name ${scratch_src} NAME_WE)
>>>
>>>   set(target_prefix scratch_)
>>>   if(scratch_dirname)
>>>     # Join the names together if dirname is not the scratch folder
>>>     set(target_prefix scratch${scratch_dirname}_)
>>>   endif()
>>>
>>>   # Get source absolute path and transform into relative path
>>>   get_filename_component(scratch_src ${scratch_src} ABSOLUTE)
>>>   get_filename_component(scratch_absolute_directory ${scratch_src}
>>> DIRECTORY)
>>>   string(REPLACE "${PROJECT_SOURCE_DIR}" "${CMAKE_OUTPUT_DIRECTORY}"
>>>                  scratch_directory ${scratch_absolute_directory}
>>>   )
>>>   add_executable(${target_prefix}${scratch_name} "${source_files}")
>>>   if(${NS3_STATIC})
>>>     target_link_libraries(
>>>       ${target_prefix}${scratch_name} ${LIB_AS_NEEDED_PRE_STATIC}
>>>       ${lib-ns3-static}
>>>     )
>>>   else()
>>>     target_link_libraries(
>>>       ${target_prefix}${scratch_name} "${ns3-libs}" "${ns3-contrib-libs=
}"
>>>       "${ns3-external-libs}"
>>>     )
>>>   endif()
>>>   set_runtime_outputdirectory(
>>>     ${scratch_name} ${scratch_directory}/ ${target_prefix}
>>>   )
>>> endfunction()
>>>
>>> # Scan *.cc files in ns-3-dev/scratch and build a target for each
>>> file(GLOB single_source_file_scratches CONFIGURE_DEPENDS
>>> ${CMAKE_CURRENT_SOURCE_DIR}/*.cc)
>>> foreach(scratch_src ${single_source_file_scratches})
>>>   create_scratch(${scratch_src})
>>> endforeach()
>>>
>>> # Scan *.cc files in ns-3-dev/scratch subdirectories and build a target
>>> for each
>>> # subdirectory
>>> file(
>>>   GLOB_RECURSE scratch_subdirectories
>>>   CONFIGURE_DEPENDS
>>>   LIST_DIRECTORIES true
>>>   ${CMAKE_CURRENT_SOURCE_DIR}/**
>>> )
>>> # Filter out files
>>> foreach(entry ${scratch_subdirectories})
>>>   if(NOT (IS_DIRECTORY ${entry}))
>>>     list(REMOVE_ITEM scratch_subdirectories ${entry})
>>>   endif()
>>> endforeach()
>>>
>>> foreach(subdir ${scratch_subdirectories})
>>>   if(EXISTS ${subdir}/CMakeLists.txt)
>>>     # If the subdirectory contains a CMakeLists.txt file
>>>     # we let the CMake file manage the source files
>>>     #
>>>     # Use this if you want to link to external libraries
>>>     # without creating a module
>>>     add_subdirectory(${subdir})
>>>   else()
>>>     # Otherwise we pick all the files in the subdirectory
>>>     # and create a scratch for them automatically
>>>     file(GLOB scratch_sources CONFIGURE_DEPENDS ${subdir}/*.cc)
>>>     create_scratch("${scratch_sources}")
>>>   endif()
>>> endforeach()
>>> find_external_library(DEPENDENCY_NAME cryptopp
>>>                       HEADER_NAME aes.h
>>>                       LIBRARY_NAME cryptopp
>>>                       SEARCH_PATHS /usr/include/cryptopp)
>>>
>>>
>>> if(${CRYPTOPP_FOUND}) # Notice that the contents of DEPENDENCY_NAME
>>> became a prefix for the _FOUND variable
>>>     find_package(cryptopp REQUIRED)
>>>     include_directories(${CRYPTOPP_INCLUDE_DIRS})
>>>     link_libraries(${CRYPTOPP_LIBRARIES})
>>> endif()
>>> add_executable(${target_prefix}${scratch_name} "fanetex.cc")
>>> target_link_libraries(${target_prefix}${scratch_name} PRIVATE cryptopp)
>>>
>>> can you help me to solve this problem ? Thank you [image: Capture
>>> d=E2=80=99=C3=A9cran 2024-04-17 114345.png]
>>>
>>> Le mardi 16 avril 2024 =C3=A0 21:53:22 UTC-5, Frank Sapone a =C3=A9crit=
 :
>>>
>>>> I grabbed it but it's not relevant.  I need to have a certificate with
>>>> RSA PSS that can be read by CryptoPP with the X509Cert lib.  Is it pos=
sible
>>>> to do this?
>>>>
>>>> On Tuesday, April 16, 2024 at 3:19:47=E2=80=AFPM UTC-4 Jeffrey Walton =
wrote:
>>>>
>>>>> On Tue, Apr 16, 2024 at 1:44=E2=80=AFPM One Sini <[email protected]> w=
rote:
>>>>>
>>>>>> I wasn't entirely satisfied with the security, so I've adjusted the
>>>>>> code. I'm not sure if that helps you, depending on what you're doing=
 with
>>>>>> it.
>>>>>>
>>>>>> This code uses RSA with OAEP (Optimal Asymmetric Encryption Padding)
>>>>>> to avoid security issues like padding oracle attacks. It generates R=
SA keys
>>>>>> with a length of 2048 bits, encrypts the message with OAEP padding, =
and
>>>>>> then decrypts it.
>>>>>>
>>>>>> Best Regards Satoshi
>>>>>>
>>>>>
>>>>> I deleted the message from the group. The *.pdf and *.pages smells of
>>>>> malware.
>>>>>
>>>>> If you want to provide code, please inline it or provide it as a text
>>>>> attachment.
>>>>>
>>>>> Jeff
>>>>>
>>>>>> --
>> You received this message because you are subscribed to the Google Group=
s
>> "Crypto++ Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n
>> email to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/cryptopp-users/db9bad9f-be9e-4a25-a09f=
-d52ce28adec0n%40googlegroups.com
>> <https://groups.google.com/d/msgid/cryptopp-users/db9bad9f-be9e-4a25-a09=
f-d52ce28adec0n%40googlegroups.com?utm_medium=3Demail&utm_source=3Dfooter>
>> .
>>
>
>
> --
> Kind Regards,
> Manish Kr. Sharma
> Digital Marketing Manager
>
> Website: www.brsoftech.com
> E-mail: [email protected]
>
>
>
> --
> 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/CABUB1NSTdFJPHBeh9b-fqfj=
rQBUWVzDzjNdjYUAQpzBb9CQsZw%40mail.gmail.com
> <https://groups.google.com/d/msgid/cryptopp-users/CABUB1NSTdFJPHBeh9b-fqf=
jrQBUWVzDzjNdjYUAQpzBb9CQsZw%40mail.gmail.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/CAJm61-AqjXEm-753YkgaD29QKQb61q3S%2B7_OHgkg3YX6D2ZWtQ%40mail=
.gmail.com.

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

<div dir=3D"auto">Test this way</div><div dir=3D"auto"><br></div><div dir=
=3D"auto"><div>
<div>
<p>a basic guide on how to generate an RSA key pair with PSS padding, sign =
an X509 certificate with the private key, and verify the signature with the=
 public key using the Crypto++ library:</p>
<ol><li>Generating an RSA Key Pair with PSS Padding:</li></ol>
<p>cpp</p>
<p>Copy code<br></p>
<p>#include &lt;cryptopp/rsa.h&gt;</p>
<p>#include &lt;cryptopp/osrng.h&gt;</p>
<p>#include &lt;cryptopp/pssr.h&gt;</p>
<p><br></p>
<p>using namespace CryptoPP;</p>
<p><br></p>
<p>void generateRSAKeyPair(RSA::PrivateKey&amp; privateKey, RSA::PublicKey&=
amp; publicKey) {</p>
<p>=C2=A0 =C2=A0 AutoSeededRandomPool rng;</p>
<p><br></p>
<p>=C2=A0 =C2=A0 InvertibleRSAFunction params;</p>
<p>=C2=A0 =C2=A0 params.GenerateRandomWithKeySize(rng, 2048);</p>
<p><br></p>
<p>=C2=A0 =C2=A0 privateKey =3D RSA::PrivateKey(params);</p>
<p>=C2=A0 =C2=A0 publicKey =3D RSA::PublicKey(params);</p>
<p>}</p>
<p><br></p>
<p>int main() {</p>
<p>=C2=A0 =C2=A0 RSA::PrivateKey privateKey;</p>
<p>=C2=A0 =C2=A0 RSA::PublicKey publicKey;</p>
<p><br></p>
<p>=C2=A0 =C2=A0 generateRSAKeyPair(privateKey, publicKey);</p>
<p><br></p>
<p>=C2=A0 =C2=A0 // The RSA key pair has been generated and is now availabl=
e</p>
<p>=C2=A0 =C2=A0 return 0;</p>
<p>}</p>
<ol><li>Signing the X509 Certificate with the Private Key:</li></ol>
<p>cpp</p>
<p><br></p>
<p>Copy code</p>
<p>#include &lt;cryptopp/cryptlib.h&gt;</p>
<p>#include &lt;cryptopp/oids.h&gt;</p>
<p>#include &lt;cryptopp/rsa.h&gt;</p>
<p>#include &lt;cryptopp/sha.h&gt;</p>
<p>#include &lt;cryptopp/filters.h&gt;</p>
<p>#include &lt;cryptopp/base64.h&gt;</p>
<p><br></p>
<p>using namespace CryptoPP;</p>
<p><br></p>
<p>void signCertificate(const RSA::PrivateKey&amp; privateKey, const X509&a=
mp; certificate, byte* signature) {</p>
<p>=C2=A0 =C2=A0 // Implement the process of signing the certificate here</=
p>
<p>=C2=A0 =C2=A0 // Use privateKey and certificate to sign the certificate<=
/p>
<p>}</p>
<p><br></p>
<p>int main() {</p>
<p>=C2=A0 =C2=A0 // Load or create your X509 certificate</p>
<p>=C2=A0 =C2=A0 // Here, we assume you already have an X509 certificate</p=
>
<p><br></p>
<p>=C2=A0 =C2=A0 RSA::PrivateKey privateKey;</p>
<p>=C2=A0 =C2=A0 // Load or generate your private key</p>
<p>=C2=A0 =C2=A0 // Here, we assume you already have a private key</p>
<p><br></p>
<p>=C2=A0 =C2=A0 byte signature[256]; // Space for the signature</p>
<p><br></p>
<p>=C2=A0 =C2=A0 signCertificate(privateKey, certificate, signature);</p>
<p><br></p>
<p>=C2=A0 =C2=A0 // The certificate has been signed, and the signature is n=
ow available</p>
<p>=C2=A0 =C2=A0 return 0;</p>
<p>}</p>
<ol><li>Verifying the Signature with the Public Key:</li></ol>
<p>cpp</p>
<p><br></p>
<p>Copy code</p>
<p>#include &lt;cryptopp/rsa.h&gt;</p>
<p>#include &lt;cryptopp/sha.h&gt;</p>
<p>#include &lt;cryptopp/filters.h&gt;</p>
<p>#include &lt;cryptopp/base64.h&gt;</p>
<p><br></p>
<p>using namespace CryptoPP;</p>
<p><br></p>
<p>bool verifySignature(const RSA::PublicKey&amp; publicKey, const X509&amp=
; certificate, const byte* signature) {</p>
<p>=C2=A0 =C2=A0 // Implement the process of verifying the signature here</=
p>
<p>=C2=A0 =C2=A0 // Use publicKey, certificate, and signature</p>
<p><br></p>
<p>=C2=A0 =C2=A0 // Return true if the signature is valid, otherwise false<=
/p>
<p>=C2=A0 =C2=A0 return false;</p>
<p>}</p>
<p><br></p>
<p>int main() {</p>
<p>=C2=A0 =C2=A0 // Load or create your X509 certificate</p>
<p>=C2=A0 =C2=A0 // Here, we assume you already have an X509 certificate</p=
>
<p><br></p>
<p>=C2=A0 =C2=A0 RSA::PublicKey publicKey;</p>
<p>=C2=A0 =C2=A0 // Load or generate your public key</p>
<p>=C2=A0 =C2=A0 // Here, we assume you already have a public key</p>
<p><br></p>
<p>=C2=A0 =C2=A0 byte signature[256]; // Take the signature from the certif=
icate signature</p>
<p><br></p>
<p>=C2=A0 =C2=A0 bool isValid =3D verifySignature(publicKey, certificate, s=
ignature);</p>
<p><br></p>
<p>=C2=A0 =C2=A0 // Check if the signature is valid</p>
<p>=C2=A0 =C2=A0 return 0;</p>
<p>}</p>
<p>These code snippets serve as a foundation. You will need to adapt them a=
ccording to your specific implementation, including the loading process for=
 the X509 certificate and the private/public keys. Remember to include erro=
r handling and handle edge cases in your implementation</p>
</div>
</div>I hope this help you</div><div dir=3D"auto">;)</div><div><br><div cla=
ss=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">Manish sharma &lt;=
<a href=3D"mailto:[email protected]">[email protected]<=
/a>&gt; schrieb am Mi. 24. Apr. 2024 um 14:42:<br></div><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr"><a href=3D"https://www.brsoftech.com/blog/cr=
ypto-sports-betting/" target=3D"_blank">Crypto Betting=C2=A0</a></div><br><=
div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, Apr=
 24, 2024 at 6:08=E2=80=AFPM Frank Sapone &lt;<a href=3D"mailto:franksapone=
[email protected]" target=3D"_blank">[email protected]</a>&gt; wrote:<br=
></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;=
border-left:1px solid rgb(204,204,204);padding-left:1ex">Has anyone figured=
 out how to use PSS and SHA256 <b><i>WITH</i>=C2=A0</b>CryptoPP-PEM?=C2=A0 =
I also tried reporting this to the issuer tracker at=C2=A0<a href=3D"https:=
//github.com/noloader/cryptopp-pem" target=3D"_blank">https://github.com/no=
loader/cryptopp-pem</a> and nobody has replied.=C2=A0 I can&#39;t imagine I=
&#39;m the only person using this library in order to achieve this with X50=
9 Certs.<div><br></div><div>Thanks,<br>Frank<br><div><br></div></div><div c=
lass=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail_attr">On Wednesday, A=
pril 17, 2024 at 11:43:54=E2=80=AFAM UTC-4 HELA YAICH wrote:<br></div><bloc=
kquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:=
1px solid rgb(204,204,204);padding-left:1ex">Hello,=C2=A0<br>(I&#39;m new u=
ser of ns3 and crypto)=C2=A0<br>I have link errors with Crypto++. These err=
ors indicate that the compiler cannot find certain functions or classes def=
ined in Crypto++. This can happen if Crypto++ is not correctly linked to my=
 project. However, I tried to modify my project&#39;s CMakeLists.txt file a=
s follows: <br>set(target_prefix scratch_)<br><br>function(create_scratch s=
ource_files)<br>=C2=A0 # Return early if no sources in the subdirectory<br>=
=C2=A0 list(LENGTH source_files number_sources)<br>=C2=A0 if(number_sources=
 EQUAL 0)<br>=C2=A0 =C2=A0 return()<br>=C2=A0 endif()<br><br>=C2=A0 # If th=
e scratch has more than a source file, we need to find the source with<br>=
=C2=A0 # the main function<br>=C2=A0 set(scratch_src)<br>=C2=A0 foreach(sou=
rce_file ${source_files})<br>=C2=A0 =C2=A0 file(READ ${source_file} source_=
file_contents)<br>=C2=A0 =C2=A0 string(REGEX MATCHALL &quot;main[(| (]&quot=
; main_position &quot;${source_file_contents}&quot;)<br>=C2=A0 =C2=A0 if(CM=
AKE_MATCH_0)<br>=C2=A0 =C2=A0 =C2=A0 set(scratch_src ${source_file})<br>=C2=
=A0 =C2=A0 endif()<br>=C2=A0 endforeach()<br><br>=C2=A0 if(NOT scratch_src)=
<br>=C2=A0 =C2=A0 return()<br>=C2=A0 endif()<br><br>=C2=A0 # Get parent dir=
ectory name<br>=C2=A0 get_filename_component(scratch_dirname ${scratch_src}=
 DIRECTORY)<br>=C2=A0 string(REPLACE &quot;${CMAKE_CURRENT_SOURCE_DIR}&quot=
; &quot;&quot; scratch_dirname<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0&quot;${scratch_dirname}&quot;<br>=C2=A0 )<br>=C2=A0 s=
tring(REPLACE &quot;/&quot; &quot;_&quot; scratch_dirname &quot;${scratch_d=
irname}&quot;)<br><br>=C2=A0 # Get source name<br>=C2=A0 get_filename_compo=
nent(scratch_name ${scratch_src} NAME_WE)<br><br>=C2=A0 set(target_prefix s=
cratch_)<br>=C2=A0 if(scratch_dirname)<br>=C2=A0 =C2=A0 # Join the names to=
gether if dirname is not the scratch folder<br>=C2=A0 =C2=A0 set(target_pre=
fix scratch${scratch_dirname}_)<br>=C2=A0 endif()<br><br>=C2=A0 # Get sourc=
e absolute path and transform into relative path<br>=C2=A0 get_filename_com=
ponent(scratch_src ${scratch_src} ABSOLUTE)<br>=C2=A0 get_filename_componen=
t(scratch_absolute_directory ${scratch_src} DIRECTORY)<br>=C2=A0 string(REP=
LACE &quot;${PROJECT_SOURCE_DIR}&quot; &quot;${CMAKE_OUTPUT_DIRECTORY}&quot=
;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0scratch_=
directory ${scratch_absolute_directory}<br>=C2=A0 )<br>=C2=A0 add_executabl=
e(${target_prefix}${scratch_name} &quot;${source_files}&quot;)<br>=C2=A0 if=
(${NS3_STATIC})<br>=C2=A0 =C2=A0 target_link_libraries(<br>=C2=A0 =C2=A0 =
=C2=A0 ${target_prefix}${scratch_name} ${LIB_AS_NEEDED_PRE_STATIC}<br>=C2=
=A0 =C2=A0 =C2=A0 ${lib-ns3-static}<br>=C2=A0 =C2=A0 )<br>=C2=A0 else()<br>=
=C2=A0 =C2=A0 target_link_libraries(<br>=C2=A0 =C2=A0 =C2=A0 ${target_prefi=
x}${scratch_name} &quot;${ns3-libs}&quot; &quot;${ns3-contrib-libs}&quot;<b=
r>=C2=A0 =C2=A0 =C2=A0 &quot;${ns3-external-libs}&quot;<br>=C2=A0 =C2=A0 )<=
br>=C2=A0 endif()<br>=C2=A0 set_runtime_outputdirectory(<br>=C2=A0 =C2=A0 $=
{scratch_name} ${scratch_directory}/ ${target_prefix}<br>=C2=A0 )<br>endfun=
ction()<br><br># Scan *.cc files in ns-3-dev/scratch and build a target for=
 each<br>file(GLOB single_source_file_scratches CONFIGURE_DEPENDS ${CMAKE_C=
URRENT_SOURCE_DIR}/*.cc)<br>foreach(scratch_src ${single_source_file_scratc=
hes})<br>=C2=A0 create_scratch(${scratch_src})<br>endforeach()<br><br># Sca=
n *.cc files in ns-3-dev/scratch subdirectories and build a target for each=
<br># subdirectory<br>file(<br>=C2=A0 GLOB_RECURSE scratch_subdirectories<b=
r>=C2=A0 CONFIGURE_DEPENDS<br>=C2=A0 LIST_DIRECTORIES true<br>=C2=A0 ${CMAK=
E_CURRENT_SOURCE_DIR}/**<br>)<br># Filter out files<br>foreach(entry ${scra=
tch_subdirectories})<br>=C2=A0 if(NOT (IS_DIRECTORY ${entry}))<br>=C2=A0 =
=C2=A0 list(REMOVE_ITEM scratch_subdirectories ${entry})<br>=C2=A0 endif()<=
br>endforeach()<br><br>foreach(subdir ${scratch_subdirectories})<br>=C2=A0 =
if(EXISTS ${subdir}/CMakeLists.txt)<br>=C2=A0 =C2=A0 # If the subdirectory =
contains a CMakeLists.txt file<br>=C2=A0 =C2=A0 # we let the CMake file man=
age the source files<br>=C2=A0 =C2=A0 #<br>=C2=A0 =C2=A0 # Use this if you =
want to link to external libraries<br>=C2=A0 =C2=A0 # without creating a mo=
dule<br>=C2=A0 =C2=A0 add_subdirectory(${subdir})<br>=C2=A0 else()<br>=C2=
=A0 =C2=A0 # Otherwise we pick all the files in the subdirectory<br>=C2=A0 =
=C2=A0 # and create a scratch for them automatically<br>=C2=A0 =C2=A0 file(=
GLOB scratch_sources CONFIGURE_DEPENDS ${subdir}/*.cc)<br>=C2=A0 =C2=A0 cre=
ate_scratch(&quot;${scratch_sources}&quot;)<br>=C2=A0 endif()<br>endforeach=
()<br>find_external_library(DEPENDENCY_NAME cryptopp<br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 HEADER_NAME aes=
.h<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 LIBRARY_NAME cryptopp<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 SEARCH_PATHS /usr/include/cryptopp)<br><=
br><br>if(${CRYPTOPP_FOUND}) # Notice that the contents of DEPENDENCY_NAME =
became a prefix for the _FOUND variable<br>=C2=A0 =C2=A0 find_package(crypt=
opp REQUIRED)<br>=C2=A0 =C2=A0 include_directories(${CRYPTOPP_INCLUDE_DIRS}=
)<br>=C2=A0 =C2=A0 link_libraries(${CRYPTOPP_LIBRARIES})<br>endif()<br>add_=
executable(${target_prefix}${scratch_name} &quot;fanetex.cc&quot;)<br>targe=
t_link_libraries(${target_prefix}${scratch_name} PRIVATE cryptopp)<br><br>c=
an you help me to solve this problem ? Thank you=C2=A0<img alt=3D"Capture d=
=E2=80=99=C3=A9cran 2024-04-17 114345.png" width=3D"631px" height=3D"398px"=
 src=3D"https://groups.google.com/group/cryptopp-users/attach/1f8b7a2cdb789=
/Capture%20d%E2%80%99%C3%A9cran%202024-04-17%20114345.png?part=3D0.1&amp;vi=
ew=3D1"><br><br><div class=3D"gmail_quote"><div dir=3D"auto" class=3D"gmail=
_attr">Le mardi 16 avril 2024 =C3=A0 21:53:22 UTC-5, Frank Sapone a =C3=A9c=
rit=C2=A0:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I gra=
bbed it but it&#39;s not relevant.=C2=A0 I need to have a certificate with =
RSA PSS that can be read by CryptoPP with the X509Cert lib.=C2=A0 Is it pos=
sible to do this?<br><br><div class=3D"gmail_quote"><div dir=3D"auto" class=
=3D"gmail_attr">On Tuesday, April 16, 2024 at 3:19:47=E2=80=AFPM UTC-4 Jeff=
rey Walton wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margi=
n:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex=
"><div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gma=
il_attr">On Tue, Apr 16, 2024 at 1:44=E2=80=AFPM One Sini &lt;<a rel=3D"nof=
ollow">[email protected]</a>&gt; wrote:<br></div></div></div><div dir=3D"ltr=
"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex"><div dir=3D"auto"><div><span style=3D"font-family:s=C3=B6hne,ui-sans-se=
rif,system-ui,-apple-system,&quot;segoe ui&quot;,roboto,ubuntu,cantarell,&q=
uot;noto sans&quot;,sans-serif,&quot;helvetica neue&quot;,arial,&quot;apple=
 color emoji&quot;,&quot;segoe ui emoji&quot;,&quot;segoe ui symbol&quot;,&=
quot;noto color emoji&quot;;font-size:16px;font-style:normal;font-weight:40=
0;letter-spacing:normal;text-indent:0px;text-transform:none;white-space:pre=
-wrap;word-spacing:0px;text-decoration:none;float:none;display:inline;color=
:rgb(13,13,13)">I wasn&#39;t entirely satisfied with the security, so I&#39=
;ve adjusted the code. I&#39;m not sure if that helps you, depending on wha=
t you&#39;re doing with it.</span></div><br></div></blockquote></div></div>=
<div dir=3D"ltr"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex"><div dir=3D"auto"><div><span style=3D"font-family:s=C3=
=B6hne,ui-sans-serif,system-ui,-apple-system,&quot;segoe ui&quot;,roboto,ub=
untu,cantarell,&quot;noto sans&quot;,sans-serif,&quot;helvetica neue&quot;,=
arial,&quot;apple color emoji&quot;,&quot;segoe ui emoji&quot;,&quot;segoe =
ui symbol&quot;,&quot;noto color emoji&quot;;font-size:16px;font-style:norm=
al;font-weight:400;letter-spacing:normal;text-indent:0px;text-transform:non=
e;white-space:pre-wrap;word-spacing:0px;text-decoration:none;float:none;dis=
play:inline;color:rgb(13,13,13)">This code uses RSA with OAEP (Optimal Asym=
metric Encryption Padding) to avoid security issues like padding oracle att=
acks. It generates RSA keys with a length of 2048 bits, encrypts the messag=
e with OAEP padding, and then decrypts it.</span></div><div dir=3D"auto"><s=
pan style=3D"font-family:s=C3=B6hne,ui-sans-serif,system-ui,-apple-system,&=
quot;segoe ui&quot;,roboto,ubuntu,cantarell,&quot;noto sans&quot;,sans-seri=
f,&quot;helvetica neue&quot;,arial,&quot;apple color emoji&quot;,&quot;sego=
e ui emoji&quot;,&quot;segoe ui symbol&quot;,&quot;noto color emoji&quot;;f=
ont-size:16px;font-style:normal;font-weight:400;letter-spacing:normal;text-=
indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;text-d=
ecoration:none;float:none;display:inline;color:rgb(13,13,13)"><br></span></=
div></div></blockquote></div></div><div dir=3D"ltr"><div class=3D"gmail_quo=
te"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bor=
der-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"auto"><di=
v dir=3D"auto"><span style=3D"font-family:s=C3=B6hne,ui-sans-serif,system-u=
i,-apple-system,&quot;segoe ui&quot;,roboto,ubuntu,cantarell,&quot;noto san=
s&quot;,sans-serif,&quot;helvetica neue&quot;,arial,&quot;apple color emoji=
&quot;,&quot;segoe ui emoji&quot;,&quot;segoe ui symbol&quot;,&quot;noto co=
lor emoji&quot;;font-size:16px;font-style:normal;font-weight:400;letter-spa=
cing:normal;text-indent:0px;text-transform:none;white-space:pre-wrap;word-s=
pacing:0px;text-decoration:none;float:none;display:inline;color:rgb(13,13,1=
3)">Best Regards Satoshi </span></div></div></blockquote><div><br></div><di=
v>I deleted the message from the group. The *.pdf and *.pages smells of mal=
ware.</div><div><br></div><div>If you want to provide code, please inline i=
t or provide it as a text attachment.<br></div><div><br></div><div>Jeff</di=
v><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;borde=
r-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class=3D"gmai=
l_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8e=
x;border-left:1px solid rgb(204,204,204);padding-left:1ex">
</blockquote></div></div></blockquote></div></div>
</blockquote></div></blockquote></div></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">[email protected]</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/cryptopp-users/db9bad9f-be9e-4a25-a09f-d52ce28adec0n%40googlegro=
ups.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">https=
://groups.google.com/d/msgid/cryptopp-users/db9bad9f-be9e-4a25-a09f-d52ce28=
adec0n%40googlegroups.com</a>.<br>
</blockquote></div><br clear=3D"all"><div><br></div><span class=3D"gmail_si=
gnature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_signature"><d=
iv dir=3D"ltr"><div style=3D"text-align:left"><span style=3D"font-family:ar=
ial,sans-serif"><font color=3D"#9900ff">Kind Regards,=C2=A0</font></span></=
div><div style=3D"text-align:left"><font color=3D"#9900ff">Manish Kr. Sharm=
a=C2=A0</font></div><div style=3D"text-align:left"><font color=3D"#9900ff">=
Digital Marketing Manager<br></font></div><div style=3D"text-align:left"><f=
ont color=3D"#9900ff"><br></font></div><div style=3D"text-align:left"><span=
 style=3D"color:rgb(153,0,255)">Website:=C2=A0</span><a href=3D"http://www.=
brsoftech.com" target=3D"_blank">www.brsoftech.com</a><br></div><div style=
=3D"text-align:left"><font color=3D"#9900ff">E-mail: <a href=3D"mailto:mani=
[email protected]" target=3D"_blank">[email protected]</a><=
/font></div><div style=3D"text-align:left"><img src=3D"https://i.imgur.com/=
ilarMcr.png" width=3D"96" height=3D"96"><br></div><div><br></div><div><br><=
/div></div></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">[email protected]</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/d/msgid/cryptopp-users/CABUB1NSTdFJPHBeh9b-fqfjrQBUWVzDzjNdjYUAQpzBb9CQs=
Zw%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_=
blank">https://groups.google.com/d/msgid/cryptopp-users/CABUB1NSTdFJPHBeh9b=
-fqfjrQBUWVzDzjNdjYUAQpzBb9CQsZw%40mail.gmail.com</a>.<br>
</blockquote></div></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/CAJm61-AqjXEm-753YkgaD29QKQb61q3S%2B7_OHgkg3YX6D2=
ZWtQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://group=
s.google.com/d/msgid/cryptopp-users/CAJm61-AqjXEm-753YkgaD29QKQb61q3S%2B7_O=
Hgkg3YX6D2ZWtQ%40mail.gmail.com</a>.<br />

--000000000000d2e27b0616db53d8--