Changeset 5ffe8ce in comparacioncriptosistemas


Ignore:
Timestamp:
Jan 14, 2016, 5:29:51 PM (8 years ago)
Author:
aaraujo <aaraujo@…>
Branches:
master, interfaz
Children:
0e18918
Parents:
fafd156
Message:

Corregido error en lectura del contenido del archivo de clave que se va a cifrar.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rsa/main.cpp

    rfafd156 r5ffe8ce  
    6363        messageFile.append(".txt");
    6464
    65         std::string s;
    66         CryptoPP::FileSource file( qPrintable(messageFile), true, new StringSink( s ) );
     65
     66        //CryptoPP::FileSource file( qPrintable(messageFile), true, new StringSink( s ) );
     67        QFile readFile(messageFile);
     68        assert (readFile.open(QFile::ReadOnly | QFile::Text));
     69        QTextStream in(&readFile);
     70
     71        std::string text = in.readAll().toStdString();
    6772
    6873        //std::cout << s ;//<< std::endl;
     
    101106                RSA::PublicKey publicKey(params);
    102107
    103                 SecByteBlock plaintext( (const unsigned char *) s.data(), s.size() );
     108                SecByteBlock plaintext( (const unsigned char *) text.data(), text.size() );
    104109
    105110
Note: See TracChangeset for help on using the changeset viewer.