noyanc / ofxLibcrypto

Small openFrameworks addon to encrypt and decrypt strings using the AES-256 algorithm which comes with OpenSSL's libcrypto library integrated into OF core.
MIT License
7 stars 2 forks source link

strange error decrypting OF string only when loaded from file #2

Open moebiussurfing opened 6 years ago

moebiussurfing commented 6 years ago

hi, when I try to decode a (previously encoded) string loaded from a file, I get an error if the original string is created like this:

ofBuffer buffer = ofBufferFromFile("myTextFile.csv");
std::string original_text = ofToString(buffer);

but when the string is defined like in your example I don't get the error:

std::string original_text;
original_text = "This is a plain text!\n\n\tqweqkwje qkwj e";

all keys and decrypt lines are the same as your example, that works fine like i said:

std::string decrypted_text;
decrypted_text = aes.decrypt(encrypted_text);

...

what could be the problem? I am on 0.9.8 in OSX Sierra, but I'll like to use the code in Windows10.... Here is the error:

captura de pantalla 2018-05-10 a la s 11 44 11