Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* *Decrypt shared secred */
- /* *Using Crypto++ */
- #include <iostream>
- #include <osrng.h>
- #include <rsa.h>
- #include <files.h>
- #include <sstream>
- #include <modes.h>
- #include <aes.h>
- using namespace CryptoPP;
- using std::stringstream;
- /* AutoSeedGen,RSA_PrivKey are taken from http://pastebin.com/8eYyKZn6 */
- RSAES<PKCS1v15>::Decryptor _rsaDecryptor(RSA_PrivKey);
- string sEncryptedSharedSecret("FILL ME WITH DATA");
- string sDecryptedSharedSecret ("");
- try {
- StringSource StrSrc(sEncryptedSharedSecret,
- true,
- new CryptoPP::PK_DecryptorFilter(AutoSeedGen,
- _rsaDecryptor,
- new StringSink(sDecryptedSharedSecret)
- )
- );
- } catch(CryptoPP::Exception) {
- std::cout<<"Houston we have a problem\n";
- }
- sDecryptedSharedSecret // Contains your decrypted shared secret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement