libquentier 0.8.0
The library for rich desktop clients of Evernote service
Loading...
Searching...
No Matches
quentier::utility::IEncryptor Struct Referenceabstract

The IEncryptor interface provides encryption and decryption functionality which is compatible with that used by Evernote service. More...

#include <IEncryptor.h>

Public Types

enum class  Cipher { RC2 , AES }
 

Public Member Functions

virtual Result< QString, ErrorStringencrypt (const QString &text, const QString &passphrase)=0
 
virtual Result< QString, ErrorStringdecrypt (const QString &encryptedText, const QString &passphrase, Cipher cipher)=0
 

Friends

QUENTIER_EXPORT QDebug & operator<< (QDebug &dbg, Cipher cipher)
 
QUENTIER_EXPORT QTextStream & operator<< (QTextStream &strm, Cipher cipher)
 

Detailed Description

The IEncryptor interface provides encryption and decryption functionality which is compatible with that used by Evernote service.

Member Enumeration Documentation

◆ Cipher

Cipher used for encryption/decryption

Enumerator
RC2 

RC2 64 bit block cipher

AES 

AES 128 bit block cipher

Member Function Documentation

◆ decrypt()

virtual Result< QString, ErrorString > quentier::utility::IEncryptor::decrypt ( const QString & encryptedText,
const QString & passphrase,
Cipher cipher )
nodiscardpure virtual

Decrypt previously encrypted text fragment

Parameters
encryptedTextEncrypted text to decrypt
passphrasePasshprase used to encrypt text
cipherCipher used to encrypt text
Returns
Result with either decrypted text or error message

◆ encrypt()

virtual Result< QString, ErrorString > quentier::utility::IEncryptor::encrypt ( const QString & text,
const QString & passphrase )
nodiscardpure virtual

Encrypt text fragment using AES cipher (RC2 cipher is only used for decryption)

Parameters
textText to encrypt
passphrasePassphrase which can be used to decrypt the text
Returns
Result with either encrypted text or error message