Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Note text encryption #231

wants to merge 3 commits into from

Conversation

jack139
Copy link

@jack139 jack139 commented Nov 9, 2024

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.

//----< convert vector of bytes to std::string >---------------------

std::string Base64::encode(const std::vector<char>& data)
{
Copy link
Owner

@robert7 robert7 Nov 12, 2024

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?

Repository owner deleted a comment from rspiegel-nc Nov 12, 2024
@@ -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"
Copy link
Owner

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)
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants