-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note text encryption #231
base: master
Are you sure you want to change the base?
Note text encryption #231
Conversation
//----< convert vector of bytes to std::string >--------------------- | ||
|
||
std::string Base64::encode(const std::vector<char>& data) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why code (body of functions) is in a header file?
@@ -34,6 +35,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
#include "src/communication/communicationmanager.h" | |||
#include "src/communication/communicationerror.h" | |||
#include "src/sql/nsqlquery.h" | |||
#include "encrypt.h" | |||
|
|||
#define CRYPT_KEY "6aabbb3efbd1ff6d606061684e9749cd476763a8" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The encryption key should never be checked in the version control. This defeats the whole purpose of encryption. Even if the code were not public, it still would only be an obfuscation.
|
||
// encrypt | ||
|
||
std::string encrypt(std::string& msg, std::string& key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use some built-in strong encryption algorithm? "Home made cryptography" is discouraged. Please use some vetted stable library to do encryption and decryption.
Adding the "{{encrypt}}" tag to the note text can automatically encrypt and decrypt the note text when syncing to Evernote. The purpose is to only want to sync between two NixNotes, and do not want the plain text to appear in the Evernote cloud.